mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Kevin Corry <corryk@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org, evms-devel@lists.sourceforge.net
Subject: Re: [PATCH] EVMS core 3/4: evms_ioctl.h
Date: Fri, 4 Oct 2002 01:49:28 +0200	[thread overview]
Message-ID: <20021004014928.A21424@wotan.suse.de> (raw)
In-Reply-To: <0210031730460A.05904@boiler>

On Thu, Oct 03, 2002 at 05:30:46PM -0500, Kevin Corry wrote:
> In general, we are aware of the issues with using 32-bit user-space on top of 
> 64-bit kernel. If you take a look at evms.c you will find several functions 
> that get registered at init-time with the 32-to-64-bit ioctl conversion code. 
> These take care of translating pointers from user-space to kernel-space in 
> this situation. EVMS has been tested on ppc64 with success, and we have 
> someone currently running tests on sparc64 to make sure it works there as 
> well.

I think you have some security holes in there: 

	+parms.buffer_address  = (u8 *)uvirt_to_kernel(parms32.buffer_address);
	[...]
	+set_fs(KERNEL_DS);
	+rc = sys_ioctl(fd, kcmd, (unsigned long)karg);
	+set_fs(old_fs);


parms32.buffer_address comes from user space. With the set_fs you turn
off all access checking. Surely when whatever sits at the bottom of 
sys_ioctl accesses it it'll use copy_from/to_user and it will do an 
unchecked reference of a user supplied pointer, allowing it to read/write
all memory.

Same bug is present in more functions.

The rule is: when you do set_fs(KERNEL_DS) you have to copy all user supplied
pointers before it.



-Andi

  reply	other threads:[~2002-10-03 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <02100307370503.05904@boiler.suse.lists.linux.kernel>
2002-10-03 15:22 ` Andi Kleen
2002-10-03 22:30   ` Kevin Corry
2002-10-03 23:49     ` Andi Kleen [this message]
2002-10-03 12:37 Kevin Corry
2002-10-03 15:00 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021004014928.A21424@wotan.suse.de \
    --to=ak@suse.de \
    --cc=corryk@us.ibm.com \
    --cc=evms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®