All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Chan-yeol Park <chanyeol.park@gmail.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] Bluetooth: Fix possible deadlock in SCO code
Date: Mon, 3 Dec 2012 15:40:14 -0200	[thread overview]
Message-ID: <20121203174014.GA2930@joana> (raw)
In-Reply-To: <50B62135.7080507@gmail.com>

Hi Chan-yeol,

* Chan-yeol Park <chanyeol.park@gmail.com> [2012-11-28 23:35:33 +0900]:

> Hi Gustavo
> 
> If we use the below patch, we face crash or circular locking
> dependency detected.
> *It's very easily reproduced(about 100%)
> 
> I guess once sco_sock_shutdown() is called,"sk" would be destructed.
> but due to response from remote side,
> sco_disconn_cfm(),sco_conn_del() would be called in order.
> and finally in sco_conn_del() crash or circular locking dependency
> is happened.
> because it access "sk" that is already destructed.
> 
> I think in sco_chan_del(), based on conn info, the relation between
> sk and conn should be cleaned
> like the original code before you commit.
> 
> [  104.889622] Bluetooth: [sco_sock_shutdown] sock e8856000, sk eb695000
> [  104.894666] Bluetooth: [sco_sock_clear_timer] sock eb695000 state 1
> [  104.900869] Bluetooth: [__sco_sock_close] sk eb695000 state 1
> socket e8856000
> [  104.907976] Bluetooth: [sco_sock_set_timer] sock eb695000 state 8
> timeout 400
> [  104.915106] Bluetooth: [sco_sock_release] sock e8856000, sk eb695000
> [  104.921439] Bluetooth: [sco_sock_clear_timer] sock eb695000 state 8
> [  104.927875] Bluetooth: [__sco_sock_close] sk eb695000 state 8
> socket e8856000
> [  104.938762] Bluetooth: [sco_chan_del] sk eb695000, conn ed38da60, err 104
> [  104.956861] Bluetooth: [sco_sock_kill] sk eb695000 state 9
> [  104.962321] Bluetooth: [sco_sock_destruct] sk eb695000
> [  105.071125] Bluetooth: [sco_disconn_cfm] hcon ed376000 reason 22
> [  105.075875] Bluetooth: [sco_conn_del] hcon ed376000 conn
> ed38da60, err 103
> [  105.082848] Bluetooth: [sco_conn_del] before bh_lock_sock () sk eb695000
> 
> Could you give me your opinion?

The patch is now reverted. I pushed it to bluetooth-next.

	Gustavo

      reply	other threads:[~2012-12-03 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15  5:41 [PATCH] Bluetooth: Fix possible deadlock in SCO code Gustavo Padovan
2012-11-28 14:35 ` Chan-yeol Park
2012-12-03 17:40   ` Gustavo Padovan [this message]

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=20121203174014.GA2930@joana \
    --to=gustavo@padovan.org \
    --cc=chanyeol.park@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.