Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv4 0/2] Fix kernel crash in rfcomm/l2cap
Date: Wed, 10 Nov 2010 17:24:54 +0200	[thread overview]
Message-ID: <1289402694.23417.2.camel@Nokia-N900> (raw)
In-Reply-To: <1289367396.9615.238.camel@aeonflux>

Hi Marcel,

> Hi Andrei,
> 
> > Yet another version of patches fixing kernel crash in RFCOMM / L2CAP.
> > *v4: taken Gustavo comments about timer HZ -> HZ/5
> > 
> > Do not delete l2cap channel and socket sk when sk is owned by user.
> > To delete l2cap channel standard timer is used.
> > 
> > lock_sock and release_sock do not hold a normal spinlock directly but 
> > instead hold the owner field. This means bh_lock_sock can still execute
> > even if the socket is "locked". More info can be found here:
> > http://www.linuxfoundation.org/collaborate/workgroups/networking/socketlocks
> > 
> > When sending following sequence:
> > ...
> > No.         Time               Source                               Destination                   
> > Protocol Info 89 1.951202                       RFCOMM     Rcvd DISC DLCI=20
> > 90 1.951324                       RFCOMM     Sent UA DLCI=20
> > 91 1.959381                       HCI_EVT     Number of Completed Packets
> > 92 1.966461                       RFCOMM     Rcvd DISC DLCI=0
> > 93 1.966492                       L2CAP       Rcvd Disconnect Request
> > 94 1.972595                       L2CAP       Sent Disconnect Response
> > 
> > ...
> > 
> > krfcommd kernel thread is preempted with l2cap tasklet which remove
> > l2cap_conn (L2CAP connection handler structure). Then rfcomm thread
> > tries to send RFCOMM UA which is reply to RFCOMM DISC and when
> > de-referencing l2cap_conn crash happens.
> 
> so I assume you have tested this extensively with various RFCOMM corner
> cases like incoming RFCOMM. Since a lot of profiles require proper
> disconnects and we have to ensure that our reference counting is
> correct.

We have the slightly modified patch applied for a several months. No regression found.

Regards,
Andrei

> 
> Other then that it seems fine to me.
> 
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> 
> Regards
> 
> Marcel
> 
> 

  reply	other threads:[~2010-11-10 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03 10:32 [PATCHv4 0/2] Fix kernel crash in rfcomm/l2cap Emeltchenko Andrei
2010-11-03 10:32 ` [PATCHv4 1/2] Bluetooth: Check sk is not owned before freeing l2cap_conn Emeltchenko Andrei
2010-11-03 10:32 ` [PATCHv4 2/2] Bluetooth: timer check sk is not owned before freeing Emeltchenko Andrei
2010-11-10  5:36 ` [PATCHv4 0/2] Fix kernel crash in rfcomm/l2cap Marcel Holtmann
2010-11-10 15:24   ` Andrei Emeltchenko [this message]
2010-11-10 16:32     ` Gustavo F. Padovan

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=1289402694.23417.2.camel@Nokia-N900 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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