Return-path: Received: from mail-iw0-f174.google.com ([209.85.214.174]:45072 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726Ab0H0WwI convert rfc822-to-8bit (ORCPT ); Fri, 27 Aug 2010 18:52:08 -0400 MIME-Version: 1.0 In-Reply-To: <20100827223926.GB32498@bougret.hpl.hp.com> References: <20100827210240.GC4703@outflux.net> <20100827212254.GB32275@bougret.hpl.hp.com> <20100827223926.GB32498@bougret.hpl.hp.com> From: "Luis R. Rodriguez" Date: Fri, 27 Aug 2010 15:51:47 -0700 Message-ID: Subject: Re: [PATCH] wireless: fix 64K kernel heap content leak via ioctl To: jt@hpl.hp.com Cc: Kees Cook , linux-kernel@vger.kernel.org, "John W. Linville" , "David S. Miller" , Eric Dumazet , Johannes Berg , Joe Perches , Tejun Heo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, Aug 27, 2010 at 3:39 PM, Jean Tourrilhes wrote: > On Fri, Aug 27, 2010 at 03:35:19PM -0700, Luis R. Rodriguez wrote: >> > >> > diff -u -p wext.j2.c wext.c >> > --- wext.j2.c   2010-08-27 14:17:26.000000000 -0700 >> > +++ wext.c      2010-08-27 14:19:33.000000000 -0700 >> > @@ -800,9 +800,12 @@ static int ioctl_standard_iw_point(struc >> >                        goto out; >> >                } >> > >> > -               if (copy_to_user(iwp->pointer, extra, >> > -                                iwp->length * >> > -                                descr->token_size)) { >> > +               /* Verify how much we should return. Some driver >> > +                * may abuse iwp->length... */ >> > +               if((iwp->length * descr->token_size) < extra_size) >> > +                       extra_size = iwp->length * descr->token_size; >> > + >> > +               if (copy_to_user(iwp->pointer, extra, extra_size)) { >> >                        err = -EFAULT; >> >                        goto out; >> >                } >> >> >> Jean, can you submit in a new thread and right before the SOB add in >> the commit log Cc: stable@kernel.org [2.6.32+] > >        The current patch was made for 2.6.27 and was only > compiled. Someone would need to verify it works for 2.6.32. I could > probably find some time next week. Got it, ah so it would be Cc: stable@kernel.org [2.6.27+]. To get this trickled in we first need it for wireless-testing.git, and provide links / patches to the backport of the patch for each kernel. Once it gets merged into Linus' tree the stable team can apply the respective backported patches. Luis