Thread (19 messages) flat view 19 messages, 9 authors, 2006-08-21

Re: [PATCH] getsockopt() early argument sanity checking

From: Andi Kleen <hidden>
Date: 2006-08-20 08:34:50
Also in: lkml

On Sunday 20 August 2006 01:05, Solar Designer wrote:
I propose the attached patch (extracted from 2.4.33-ow1) for inclusion
into 2.4.34-pre.

(2.6 kernels could benefit from the same change, too, but at the moment
I am dealing with proper submission of generic changes like this that
are a part of 2.4.33-ow1.)
In general I don't think it makes sense to submit stuff for 2.4 
that isn't in 2.6.
The patch makes getsockopt(2) sanity-check the value pointed to by
the optlen argument early on.  This is a security hardening measure
intended to prevent exploitation of certain potential vulnerabilities in
socket type specific getsockopt() code on UP systems.
It's not only insufficient on SMP, but even on UP where a thread
can sleep in get_user and another one can run in this time.

Doing a check that is inherently racy everywhere doesn't seem like
a security improvement to me. If there is really a length checking bug somewhere 
it needs to be fixed in a race-free way. If not then there is no need
for a change.

-Andi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help