Message ID | 20241118153301.2603131-1-luiz.dentz@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v2] Bluetooth: MGMT: Fix slab-use-after-free Read in set_powered_sync | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/SubjectPrefix | success | Gitlint PASS |
tedd_an/BuildKernel | fail | BuildKernel: FAIL: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 |
tedd_an/CheckAllWarning | fail | CheckAllWarning: FAIL: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 |
tedd_an/CheckSparse | fail | CheckSparse: FAIL: net/bluetooth/af_bluetooth.c:245:25: warning: context imbalance in 'bt_accept_enqueue' - different lock contexts for basic block net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h): ./include/net/bluetooth/hci.h:2616:47: warning: array of flexible structures ./include/net/bluetooth/hci.h:2702:43: warning: array of flexible structures cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... drivers/bluetooth/hci_ag6xx.c:257:24: warning: restricted __le32 degrades to integer drivers/bluetooth/hci_mrvl.c:170:23: warning: restricted __le16 degrades to integer drivers/bluetooth/hci_mrvl.c:203:23: warning: restricted __le16 degrades to integer drivers/bluetooth/hci_nokia.c:279:23: warning: incorrect type in assignment (different base types) drivers/bluetooth/hci_nokia.c:279:23: expected unsigned short [usertype] baud drivers/bluetooth/hci_nokia.c:279:23: got restricted __le16 [usertype] drivers/bluetooth/hci_nokia.c:282:26: warning: incorrect type in assignment (different base types) drivers/bluetooth/hci_nokia.c:282:26: expected unsigned short [usertype] sys_clk drivers/bluetooth/hci_nokia.c:282:26: got restricted __le16 [usertype] make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 |
tedd_an/BuildKernel32 | fail | BuildKernel32: FAIL: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 |
tedd_an/TestRunnerSetup | fail | Kernel Build FAIL: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 |
tedd_an/TestRunner_l2cap-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_iso-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_bnep-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_mgmt-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_rfcomm-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_sco-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_ioctl-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_mesh-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_smp-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
tedd_an/TestRunner_userchan-tester | fail | Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=910677 ---Test result--- Test Summary: CheckPatch PENDING 0.35 seconds GitLint PENDING 0.21 seconds SubjectPrefix PASS 0.12 seconds BuildKernel FAIL 21.63 seconds CheckAllWarning FAIL 23.66 seconds CheckSparse FAIL 26.32 seconds BuildKernel32 FAIL 21.62 seconds TestRunnerSetup FAIL 421.85 seconds TestRunner_l2cap-tester FAIL 0.15 seconds TestRunner_iso-tester FAIL 0.14 seconds TestRunner_bnep-tester FAIL 0.15 seconds TestRunner_mgmt-tester FAIL 0.14 seconds TestRunner_rfcomm-tester FAIL 0.14 seconds TestRunner_sco-tester FAIL 0.14 seconds TestRunner_ioctl-tester FAIL 0.14 seconds TestRunner_mesh-tester FAIL 0.15 seconds TestRunner_smp-tester FAIL 0.14 seconds TestRunner_userchan-tester FAIL 0.17 seconds IncrementalBuild PENDING 0.55 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: BuildKernel - FAIL Desc: Build Kernel for Bluetooth Output: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 ############################## Test: CheckAllWarning - FAIL Desc: Run linux kernel with all warning enabled Output: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 ############################## Test: CheckSparse - FAIL Desc: Run sparse tool with linux kernel Output: net/bluetooth/af_bluetooth.c:245:25: warning: context imbalance in 'bt_accept_enqueue' - different lock contexts for basic block net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h): ./include/net/bluetooth/hci.h:2616:47: warning: array of flexible structures ./include/net/bluetooth/hci.h:2702:43: warning: array of flexible structures cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... drivers/bluetooth/hci_ag6xx.c:257:24: warning: restricted __le32 degrades to integer drivers/bluetooth/hci_mrvl.c:170:23: warning: restricted __le16 degrades to integer drivers/bluetooth/hci_mrvl.c:203:23: warning: restricted __le16 degrades to integer drivers/bluetooth/hci_nokia.c:279:23: warning: incorrect type in assignment (different base types) drivers/bluetooth/hci_nokia.c:279:23: expected unsigned short [usertype] baud drivers/bluetooth/hci_nokia.c:279:23: got restricted __le16 [usertype] drivers/bluetooth/hci_nokia.c:282:26: warning: incorrect type in assignment (different base types) drivers/bluetooth/hci_nokia.c:282:26: expected unsigned short [usertype] sys_clk drivers/bluetooth/hci_nokia.c:282:26: got restricted __le16 [usertype] make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 ############################## Test: BuildKernel32 - FAIL Desc: Build 32bit Kernel for Bluetooth Output: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 ############################## Test: TestRunnerSetup - FAIL Desc: Setup kernel and bluez for test-runner Output: Kernel: net/bluetooth/mgmt.c: In function ‘set_powered_sync’: net/bluetooth/mgmt.c:1358:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] 1358 | return; | ^~~~~~ net/bluetooth/mgmt.c:1351:12: note: declared here 1351 | static int set_powered_sync(struct hci_dev *hdev, void *data) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:229: net/bluetooth/mgmt.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [scripts/Makefile.build:478: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:478: net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1936: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2 ############################## Test: TestRunner_l2cap-tester - FAIL Desc: Run l2cap-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_iso-tester - FAIL Desc: Run iso-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_bnep-tester - FAIL Desc: Run bnep-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_rfcomm-tester - FAIL Desc: Run rfcomm-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_sco-tester - FAIL Desc: Run sco-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_ioctl-tester - FAIL Desc: Run ioctl-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_smp-tester - FAIL Desc: Run smp-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: TestRunner_userchan-tester - FAIL Desc: Run userchan-tester with test-runner Output: Could not access KVM kernel module: No such file or directory qemu-system-x86_64: failed to initialize KVM: No such file or directory qemu-system-x86_64: Back to tcg accelerator qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 1f6d083682b8..1fe72d1f96f8 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1351,7 +1351,13 @@ static void mgmt_set_powered_complete(struct hci_dev *hdev, void *data, int err) static int set_powered_sync(struct hci_dev *hdev, void *data) { struct mgmt_pending_cmd *cmd = data; - struct mgmt_mode *cp = cmd->param; + struct mgmt_mode *cp; + + /* Make sure cmd still outstanding. */ + if (cmd != pending_find(MGMT_OP_SET_POWERED, hdev)) + return; + + cp = cmd->param; BT_DBG("%s", hdev->name); @@ -1432,6 +1438,11 @@ static void settings_rsp(struct mgmt_pending_cmd *cmd, void *data) { struct cmd_lookup *match = data; + /* dequeue cmd_sync entries using cmd as data as that is about to be + * removed/freed. + */ + hci_cmd_sync_dequeue(match->hdev, NULL, cmd, NULL); + send_settings_rsp(cmd->sk, cmd->opcode, match->hdev); list_del(&cmd->list);