lkml.org 
[lkml]   [2016]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ppdev: fix double-free of pp->pdev->name
On Sun, Oct 30, 2016 at 11:24:27PM +0530, Sudip Mukherjee wrote:
> On Sunday 30 October 2016 09:14 PM, 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] ==========================================================
> >
> >CCing Andy Lutomirski because I think this is what broke vmapped stacks
> >for me - after applying this patch, vmapped stacks worked for me.
> >Previously, I got oopses (and lockups) caused by area->pages[0] being
> >0x400000000 in __vunmap(), with area->pages being allocated in the kmalloc
> >area.
>
> I think the above should not be a part of the commit message.

Ah, yes.

@maintainers: Feel free to remove that from the commit message. Or should I
resend?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-10-30 19:01    [W:0.060 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site