Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBVFT81UT8ZU.1QI0T263LML5J@posteo.net>
Date: Wed, 06 Aug 2025 15:07:38 +0000
From: "Sertonix" <sertonix@...teo.net>
To: <musl@...ts.openwall.com>
Subject: ctr registry after syscall on powerpc

(Sorry for the noise, I don't know any better place to ask)

With GCC 15 I get a compiled musl libc that stores a value in the ctr
registry, doing a syscall which changes the ctr registry and then
reading back garbage data when trying to read the original value. I
unfortunatly couldn't find any information do determine if this is an
issue in musl, gcc or the kernel.

The relevant code from src/malloc/mallocng/malloc.c:

	size_t pagesize = PGSZ; // stored into ctr registry
	...
	ctx.brk = brk(0); // mess up ctr registry
	...
	ctx.brk += -ctx.brk & (pagesize-1); // try to read back ctr registry

When I mark ctr as clobber in __syscall1 I don't see this issue. Is
that a correct fix?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.