diff mbox series

Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor()

Message ID ea64b27e-6cbf-fdd5-1f23-aecc3a308e47@I-love.SAKURA.ne.jp (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 86 this patch: 86
netdev/cc_maintainers fail 2 blamed authors not CCed: mmandlik@google.com mcchou@google.com; 2 maintainers not CCed: mmandlik@google.com mcchou@google.com
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 86 this patch: 86
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tetsuo Handa Aug. 17, 2022, 11:14 a.m. UTC
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 [1]
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>
---
 net/bluetooth/mgmt.c | 1 -
 1 file changed, 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org Aug. 17, 2022, 6:52 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 17 Aug 2022 20:14:36 +0900 you wrote:
> 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 [1]
> 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>
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_sync: fix double mgmt_pending_free() in remove_adv_monitor()
    https://git.kernel.org/bluetooth/bluetooth-next/c/ae2b5c97cd40

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 6e31023b84f5..3d2e0773a1c1 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -5054,7 +5054,6 @@  static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev,
 		else
 			status = MGMT_STATUS_FAILED;
 
-		mgmt_pending_remove(cmd);
 		goto unlock;
 	}