linux-mips
[Top] [All Lists]

Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory

To: Chad Reese <creese@caviumnetworks.com.redhat.com>
Subject: Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 25 Jul 2006 22:07:20 -0400
Cc: linux-mips@linux-mips.org
In-reply-to: <44C6B829.8050508@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <44C6B829.8050508@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Tue, Jul 25, 2006 at 05:32:41PM -0700, Chad Reese wrote:

> If you're running a 64bit kernel with N32 userspace, shmctl will corrupt
> memory in userspace. When copy_shmid_to_user() is called, it copies the
> entire kernel shmid_ds into userspace. For a 64bit kernel, this is 88
> bytes. In N32 userspace it is 76 bytes.
> 
> My hack to get around the problem is attached, but I expect someone here
> will be able to come up with a better fix. shmid_ds contains a lot of
> members that are marked unused. Are these really useless?

They need to be there for compatibility with older revisions of the
structure - we can increase the size of the structure but not decrease.

Talking about compatibility, you change breaks N64 compatibility ...

  Ralf

<Prev in Thread] Current Thread [Next in Thread>