From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755496AbcKJLdK (ORCPT ); Thu, 10 Nov 2016 06:33:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755457AbcKJLdI (ORCPT ); Thu, 10 Nov 2016 06:33:08 -0500 Date: Thu, 10 Nov 2016 07:57:12 +0100 From: Greg Kroah-Hartman To: Jann Horn Cc: Arnd Bergmann , Sudip Mukherjee , linux-kernel@vger.kernel.org, linux-parport@lists.infradead.org, Andy Lutomirski Subject: Re: [PATCH v2] ppdev: fix double-free of pp->pdev->name Message-ID: <20161110065712.GC29860@kroah.com> References: <1477865964-4497-1-git-send-email-jann@thejh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477865964-4497-1-git-send-email-jann@thejh.net> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 30, 2016 at 11:19:24PM +0100, Jann Horn wrote: > free_pardevice() is called by parport_unregister_device() and already frees > pp->pdev->name, don't try to do it again. > > This bug causes kernel crashes. > > I found and verified this with KASAN and some added pr_emerg()s: > > [ 60.316568] pp_release: pp->pdev->name == ffff88039cb264c0 > [ 60.316692] free_pardevice: freeing par_dev->name at ffff88039cb264c0 > [ 60.316706] pp_release: kfree(ffff88039cb264c0) > [ 60.316714] ========================================================== > [ 60.316722] BUG: Double free or freeing an invalid pointer > [ 60.316731] Unexpected shadow byte: 0xFB > [ 60.316801] Object at ffff88039cb264c0, in cache kmalloc-32 size: 32 > [ 60.316813] Allocated: > [ 60.316824] PID = 1695 > [ 60.316869] Freed: > [ 60.316880] PID = 1695 > [ 60.316935] ========================================================== > > Signed-off-by: Jann Horn > --- > drivers/char/ppdev.c | 3 --- > 1 file changed, 3 deletions(-) Sudip, I need an ack here before I can take this...