This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: shmat apparently broken on n32 MIPS.


Mike Frysinger wrote: 
> On Friday 01 December 2006 14:36, Kaz Kylheku wrote:
> > The shmat() function is behaving strangely.
> 
> if you posted a small C test case that exhibits the behavior you're 
> describing, it'd make everything a lot easier
> -mike

It's a kernel problem that, it turns out, has already been fixed in the
linux-mips kernel stream. 

The small C test case is: call shmat(<valid-shmid>, 0, 0) and watch it
fail.

The reason for the behavior is that, mistakenly, an incorrectly written
function called sys32_shmat was developed for MIPS and patched into the
n32 syscall table, when in fact the regular sys_shmat is quite
appropriate.

The reason for the EFAULT is that this sys32_shmat thinks that it's
getting an extra parameter from user space: a pointer to a 32 bit
address where to store the result. When it tries the put_user, there is
a null pointer dereference.
Since shmat doesn't in fact have a poiner-to-pointer parameter, there is
no need to have a sys32_ compatibility version of it at all.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]