public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Jann Horn <jann@thejh.net>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-parport@lists.infradead.org,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH v2] ppdev: fix double-free of pp->pdev->name
Date: Thu, 10 Nov 2016 12:40:40 +0000	[thread overview]
Message-ID: <20161110124040.GB1477@sudip-tp> (raw)
In-Reply-To: <1477865964-4497-1-git-send-email-jann@thejh.net>

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 <jann@thejh.net>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

  parent reply	other threads:[~2016-11-10 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-30 22:19 [PATCH v2] ppdev: fix double-free of pp->pdev->name Jann Horn
2016-11-10  6:57 ` Greg Kroah-Hartman
2016-11-10 12:40 ` Sudip Mukherjee [this message]
2016-11-10 13:18 ` Arnd Bergmann
2016-11-10 13:50   ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161110124040.GB1477@sudip-tp \
    --to=sudipm.mukherjee@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jann@thejh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parport@lists.infradead.org \
    --cc=luto@amacapital.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox