public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, Netdev <netdev@oss.sgi.com>,
	Solar Designer <solar@openwall.com>
Subject: Re: [PATCH] getsockopt() early argument sanity checking
Date: Sun, 20 Aug 2006 20:57:18 +0200	[thread overview]
Message-ID: <44E8B08E.20507@colorfullife.com> (raw)

Arjan wrote:

>> We're on UP.  sys_getsockopt() does get_user() (due to the patch) and
>> makes sure that the passed *optlen is sane.  Even if this get_user()
>> sleeps, the value it returns in "len" is what's currently in memory at
>> the time of the get_user() return (correct?)  Then an underlying
>> *getsockopt() function does another get_user() on optlen (same address),
>> without doing any other user-space data accesses or anything else that
>> could sleep first.  Is it possible that this second get_user()
>> invocation would sleep?  I think not since it's the same address that
>> we've just read a value from, we did not leave kernel space, and we're
>> on UP (so no other processor could have changed the mapping).  So the
>> patch appears to be sufficient for this special case (which is not
>> unlikely).
>
>this reasoning goes out the window with kernel preemption of course ;)
>  
>
Or O_DIRECT? I'm not sure what's easier to time, a kernel preemption or 
a DMA to the user address.

--
    Manfred


             reply	other threads:[~2006-08-20 18:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-20 18:57 Manfred Spraul [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-19 23:05 [PATCH] getsockopt() early argument sanity checking Solar Designer
2006-08-19 23:48 ` Willy Tarreau
2006-08-20  0:05   ` Michael Buesch
2006-08-20  0:43     ` Willy Tarreau
2006-08-20 19:44       ` David Miller
2006-08-20 20:35         ` Willy Tarreau
2006-08-20 21:12           ` Arjan van de Ven
2006-08-21 12:09       ` Eugene Teo
2006-08-20  8:34 ` Andi Kleen
2006-08-20 10:15   ` Willy Tarreau
2006-08-20 10:50     ` YOSHIFUJI Hideaki / 吉藤英明
2006-08-20 19:46     ` David Miller
2006-08-20 16:16   ` Solar Designer
2006-08-20 16:30     ` Arjan van de Ven
2006-08-20 19:47       ` David Miller
2006-08-20 18:38     ` Andi Kleen
2006-08-20 19:45       ` Solar Designer
2006-08-20 19:45   ` David Miller
2006-08-20 18:15 ` Alan Cox
2006-08-21  3:00 ` David Wagner
2006-08-21  8:24   ` Solar Designer

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=44E8B08E.20507@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=solar@openwall.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