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  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, 31 Jul 2011 08:49:21 -0400
From:	Andy Walls <>
To:	Dan Carpenter <>, Jesper Juhl <>
	Jarod Wilson <>,
	Jerome Brock <>,
	Mauro Carvalho Chehab <>,
	Gerd Knorr <>,
	Jarod Wilson <>,
	Greg Kroah-Hartman <>,
	Thomas Reitmayr <>,
	Michal Kochanowicz <>,
	Christoph Bartelmus <>,
	Mark Weaver <>,
	Ulrich Mueller <>,
	Stefan Jahn <>
Subject: Re: [PATCH] staging; lirc, zilog: put_ir_rx may free 'rx' which can
 lead to double free

On Sun, 2011-07-31 at 08:42 -0400, Andy Walls wrote:
> On Fri, 2011-07-29 at 09:08 +0300, Dan Carpenter wrote:
> > On Thu, Jul 28, 2011 at 11:49:51PM +0200, Jesper Juhl wrote:
> > > If calling put_ir_rx(rx, true); in
> > > drivers/staging/lirc/lirc_zilog.c::ir_probe() returns true (1) then it
> > > means that it has freed it's first argument. Subsequently jumping to
> > > 'out_put_xx' will cause us to call put_ir_rx() once more since 'rx' is
> > > not zero - leading to a double free.
> > 
> > It would be better to just remove the first call to put_ir_rx().
> Jesper,
> (Emails from you don't seem to make it to me, so I looked at your patch
> in archive.)
> Good catch!


Ah crud.  I take that back.

NACK on either form of the patch.

lirc_zilog is a ref counting PITA.  Look at ir_probe() again.

We grab 2 rx refs.

One at the line 


and another at

	/* An rx ref goes to the i2c_client */
        i2c_set_clientdata(client, get_ir_rx(ir));

On failure, we need two "put_ir_rx(rx, true)" calls.

That's why I wrote the comment to myself:

         /* Failure exit, so put back rx ref from i2c_client */
         i2c_set_clientdata(client, NULL);
         put_ir_rx(rx, true);


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists