]> git.itanic.dy.fi Git - linux-stable/commitdiff
Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Wed, 17 Aug 2022 11:14:36 +0000 (20:14 +0900)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 25 Aug 2022 23:21:41 +0000 (16:21 -0700)
syzbot is reporting double kfree() at remove_adv_monitor() [1], for
commit 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv
Monitor") forgot to remove duplicated mgmt_pending_remove() when
merging "if (err) {" path and "if (!pending) {" path.

Link: https://syzkaller.appspot.com/bug?extid=915a8416bf15895b8e07
Reported-by: syzbot <syzbot+915a8416bf15895b8e07@syzkaller.appspotmail.com>
Fixes: 7cf5c2978f23fdbb ("Bluetooth: hci_sync: Refactor remove Adv Monitor")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c

index 1cd7d6572892e43289381c3095bb66eb259820b0..77e7aa63c0c08051f24a8ce8a76853837930405b 100644 (file)
@@ -5066,7 +5066,6 @@ static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev,
                else
                        status = MGMT_STATUS_FAILED;
 
-               mgmt_pending_remove(cmd);
                goto unlock;
        }