Re: Syscall changes registers beyond %eax, on linux-i386

Mikael Pettersson
2002-09-19T20:20:08Z

Daniel Jacobowitz writes:
> That's not going to help. As Richard said, the memory in question
> belongs to the called function. GCC knows this. It can freely modify
> it. The fact that the value of the parameter is const is a
> language-level, semantic thing. It doesn't say anything about the
> const-ness of that memory. Only the ABI does.

Does Linux/x86 even have a proper ABI document? I've never seen one.
The closest I've seen would be the SVR4 i386 psABI, but it
deliberately doesn't define the raw syscall interface, only the
each-syscall-is-a-C-function one implemented by the C library,
and that interface doesn't suffer from the current issue.

IOW, the kernel may not be at fault if user-space code invokes int
$0x80 directly and then sees clobbered registers.

/Mikael