[lkml]   [2012]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 1/2] bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close
    Hi Marcel,

    On Wed, Mar 07, 2012 at 11:33:17AM -0800, Marcel Holtmann wrote:
    > Hi Johan,
    > > Do not close protocol driver until device has been unregistered.
    > >
    > > This fixes a race between tty_close and hci_dev_open which can result in
    > > a NULL-pointer dereference.
    > >
    > > The line discipline closes the protocol driver while we may still have
    > > hci_dev_open sleeping on the req_lock mutex resulting in a NULL-pointer
    > > dereference when lock is acquired and hci_init_req called.


    > what kernel version is this against? Our changes in bluetooth-next fixed
    > some of the destruct handling.

    This is against the latest rc as it needs to be fixed in 3.3, but I
    missed a dependency to bluetooth-next as you point out below.

    > Also hci_unregister_dev should be calling the destruct handler and thus
    > your change is now accessing hu but it got freed already.

    You're right, my patch depends on 010666a126fc ("Bluetooth: Make
    hci-destruct callback optional") and 797fe796c4 ("Bluetooth: uart-ldisc:
    Fix memory leak and remove destruct cb") from bluetooth-next.

    But since the latter one fixes a memory leak it should have been marked
    for stable as well as pushed to Linus for 3.3, right?


     \ /
      Last update: 2012-03-08 12:59    [W:0.022 / U:6.452 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site