lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 5 Jun 2011 11:50:37 +0200
From:	Andre Bartke <andre.bartke@...glemail.com>
To:	Connor H <cmdkhh@...il.com>
Cc:	Andre Bartke <andre.bartke@...glemail.com>,
	Michal Nazarewicz <mina86@...a86.com>, gregkh@...e.de,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/usb/gadget: add missing kfree calls

On Sat, 4 Jun 2011 18:35:35 -0700
Connor H <cmdkhh@...il.com> wrote:

> On Sat, Jun 4, 2011 at 2:54 PM, Andre Bartke
> <andre.bartke@...glemail.com> wrote:
> > On Sat, 04 Jun 2011 23:35:16 +0200
> > "Michal Nazarewicz" <mina86@...a86.com> wrote:
> >
> >> On Sat, 04 Jun 2011 21:34:54 +0200, Andre Bartke
> >> <andre.bartke@...glemail.com> wrote:
> >> > diff --git a/drivers/usb/gadget/rndis.c
> >> > b/drivers/usb/gadget/rndis.c @@ -700,6 +701,7 @@ static int
> >> > rndis_reset_response(int configNr, rndis_reset_msg_type *buf)
> >> >     resp->AddressingReset = cpu_to_le32(1);
> >> >     params->resp_avail(params->v);
> >> > +   kfree(r);
> >> >     return 0;
> >> >  }
> >>
> >> Have you tested this?  It does not look right to me.
> >> rndis_add_response() allocates memory and puts the request on a
> >> list.  It is later freed in rndis_free_response().
> >>
> >
> > Nope, the only way I can test this is a build - which it does.
> > You might be right though.
> 
> building != correct
> 
> r is being added to a list in rndis_add_response
> Andre is right, rndis_free_response handles list removal
> 
> 982 if (r && r->buf == buf) {
> 983                         list_del(&r->list);
> 984                         kfree(r);
> 985                 }
> 
> in fact all of the kfree calls I believe are incorrect.
> 
> Connor

alright, then drop this patch please.

> 
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-kernel" in the body of a message to majordomo@...r.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ