From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756136Ab1G2K0y (ORCPT ); Fri, 29 Jul 2011 06:26:54 -0400 Received: from swampdragon.chaosbits.net ([90.184.90.115]:16805 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756056Ab1G2K0x (ORCPT ); Fri, 29 Jul 2011 06:26:53 -0400 Date: Fri, 29 Jul 2011 12:26:51 +0200 (CEST) From: Jesper Juhl To: Andy Walls cc: Dan Carpenter , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, 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 In-Reply-To: Message-ID: References: <20110729060822.GF3752@shale.localdomain> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Jul 2011, Andy Walls wrote: > 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(). > > > >regards, > >dan carpenter > > Jesper, > > Could you forward your original patch email to me? I never got it. > > I was the one who added all the new ref counting to lirc_zilog and it was not fun to get right (well at least what I thought was right...). > Sure. I've just forwarded both the original patch mail and the mail with the updated version to Andy Walls -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please.