public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+d7ce59b06b3eb14fd218@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] Re: [PATCH v1] Bluetooth: RFCOMM: FIX possible deadlock in rfcomm_sk_state_change
Date: Tue, 01 Oct 2024 07:58:36 -0700	[thread overview]
Message-ID: <66fc0e1c.050a0220.f28ec.04aa.GAE@google.com> (raw)
In-Reply-To: <00000000000061641905cbd98d7b@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [PATCH v1] Bluetooth: RFCOMM: FIX possible deadlock in rfcomm_sk_state_change
Author: luiz.dentz@gmail.com

#syz test

On Mon, Sep 30, 2024 at 4:36 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> On Mon, Sep 30, 2024 at 3:30 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > rfcomm_sk_state_change attempts to use sock_lock so it must never be
> > called with it locked but rfcomm_sock_ioctl always attempt to lock it
> > causing the following trace:
> >
> > ======================================================
> > WARNING: possible circular locking dependency detected
> > 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted
> > ------------------------------------------------------
> > syz-executor386/5093 is trying to acquire lock:
> > ffff88807c396258 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1671 [inline]
> > ffff88807c396258 (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at: rfcomm_sk_state_change+0x5b/0x310 net/bluetooth/rfcomm/sock.c:73
> >
> > but task is already holding lock:
> > ffff88807badfd28 (&d->lock){+.+.}-{3:3}, at: __rfcomm_dlc_close+0x226/0x6a0 net/bluetooth/rfcomm/core.c:491
> >
> > Reported-by: syzbot+d7ce59b06b3eb14fd218@syzkaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=d7ce59b06b3eb14fd218
> > Fixes: 3241ad820dbb ("[Bluetooth] Add timestamp support to L2CAP, RFCOMM and SCO")
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > ---
> >  net/bluetooth/rfcomm/sock.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
> > index 37d63d768afb..f48250e3f2e1 100644
> > --- a/net/bluetooth/rfcomm/sock.c
> > +++ b/net/bluetooth/rfcomm/sock.c
> > @@ -865,9 +865,7 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
> >
> >         if (err == -ENOIOCTLCMD) {
> >  #ifdef CONFIG_BT_RFCOMM_TTY
> > -               lock_sock(sk);
> >                 err = rfcomm_dev_ioctl(sk, cmd, (void __user *) arg);
> > -               release_sock(sk);
> >  #else
> >                 err = -EOPNOTSUPP;
> >  #endif
> > --
> > 2.46.1
> >
>
>
> --
> Luiz Augusto von Dentz



-- 
Luiz Augusto von Dentz

      reply	other threads:[~2024-10-01 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  5:15 [syzbot] possible deadlock in rfcomm_sk_state_change syzbot
2024-10-01 14:58 ` syzbot [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=66fc0e1c.050a0220.f28ec.04aa.GAE@google.com \
    --to=syzbot+d7ce59b06b3eb14fd218@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /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