From: Paul Mackerras <paulus@samba.org>
To: Andrew Morton <akpm@digeo.com>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: copy_from_user
Date: Wed, 18 Jun 2003 22:26:15 +1000 (EST) [thread overview]
Message-ID: <16112.23143.230698.175126@nanango.paulus.ozlabs.org> (raw)
In-Reply-To: <20030618003110.6a9751a5.akpm@digeo.com>
Andrew Morton writes:
> This was not deliberate - the memset simply got lost.
>
> It is simple enough to fix. Do we remember the details of the
> security hole?
My memory is a little hazy since it is several years ago, but as I
remember it, when you did a write on a pipe, the code would do
copy_from_user and not check the return value. So, if you did a write
from an unmapped address, and then a read from the pipe, you would get
whatever was in the page that the kernel had allocated as the pipe
buffer. Tridge had a program that would read out the contents of most
of kernel memory by doing this (I think he had a loop that created a
pipe, did a 4k write from a bad address and then a 4k read, then close
the pipe). IIRC it relied on the kernel usually using a different
page for each pipe.
The primary fix was of course to make the pipe code check the return
value from copy_from_user and return an EFAULT error. But the
question was then, how many other places were there that did the same
thing? So the zeroing of the destination was added as a backup to
make sure that we wouldn't leak the contents of kernel memory as a
result of not checking the result from copy_from_user. It's a
belt-and-braces kind of thing really.
> > or if the size is 1, 2 or 4.
>
> This one is OK - __get_user_asm() does the zeroing in the fixup code.
Ah, good. Maybe ppc should do that too. :)
Paul.
prev parent reply other threads:[~2003-06-18 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-18 6:50 copy_from_user Paul Mackerras
2003-06-18 7:31 ` copy_from_user Andrew Morton
2003-06-18 12:26 ` Paul Mackerras [this message]
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=16112.23143.230698.175126@nanango.paulus.ozlabs.org \
--to=paulus@samba.org \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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®