Message ID | 20231211144037.2039209-1-hedonistsmith@gmail.com |
---|---|
State | New |
Headers | show |
Series | [1/1] Bluetooth: Fix UAF in __sco_sock_close | expand |
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=808810 ---Test result--- Test Summary: CheckPatch FAIL 0.98 seconds GitLint FAIL 0.60 seconds SubjectPrefix PASS 0.13 seconds BuildKernel PASS 28.33 seconds CheckAllWarning PASS 31.08 seconds CheckSparse WARNING 36.40 seconds CheckSmatch WARNING 99.66 seconds BuildKernel32 PASS 27.47 seconds TestRunnerSetup PASS 426.62 seconds TestRunner_l2cap-tester PASS 23.28 seconds TestRunner_iso-tester PASS 91.06 seconds TestRunner_bnep-tester PASS 7.16 seconds TestRunner_mgmt-tester PASS 162.53 seconds TestRunner_rfcomm-tester PASS 11.12 seconds TestRunner_sco-tester PASS 12.67 seconds TestRunner_ioctl-tester PASS 12.28 seconds TestRunner_mesh-tester PASS 9.07 seconds TestRunner_smp-tester PASS 9.91 seconds TestRunner_userchan-tester PASS 7.46 seconds IncrementalBuild PASS 26.47 seconds Details ############################## Test: CheckPatch - FAIL Desc: Run checkpatch.pl script Output: [1/1] Bluetooth: Fix UAF in __sco_sock_close WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) #92: atomic_dec_and_test ./include/linux/atomic/atomic-instrumented.h:1375 [inline] total: 0 errors, 1 warnings, 0 checks, 21 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/src/13487356.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ############################## Test: GitLint - FAIL Desc: Run gitlint Output: [1/1] Bluetooth: Fix UAF in __sco_sock_close WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 10: B1 Line exceeds max length (87>80): "BUG: KASAN: slab-use-after-free in __sco_sock_close+0x2d7/0x6b0 net/bluetooth/sco.c:444" 39: B1 Line exceeds max length (199>80): "Code: 03 00 00 00 0f 05 48 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 d3 eb 02 00 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 21 ec 02 00 8b 44" 102: B1 Line exceeds max length (90>80): "page:ffffea0000711e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c478" 110: B1 Line exceeds max length (199>80): "page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 6803836749, free_ts 0" ############################## Test: CheckSparse - WARNING Desc: Run sparse tool with linux kernel Output: net/bluetooth/sco.c: note: in included file:./include/net/bluetooth/hci_core.h:150:35: warning: array of flexible structures ############################## Test: CheckSmatch - WARNING Desc: Run smatch tool with source Output: net/bluetooth/sco.c: note: in included file:./include/net/bluetooth/hci_core.h:150:35: warning: array of flexible structures --- Regards, Linux Bluetooth
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index c736186ab..46e158bdd 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -296,6 +296,7 @@ static int sco_connect(struct sock *sk) sco_sock_set_timer(sk, sk->sk_sndtimeo); } + hci_conn_get(hcon); release_sock(sk); unlock: @@ -438,12 +439,13 @@ static void __sco_sock_close(struct sock *sk) case BT_CONNECTED: case BT_CONFIG: if (sco_pi(sk)->conn->hcon) { + struct hci_conn *hcon = sco_pi(sk)->conn->hcon; sk->sk_state = BT_DISCONN; sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT); sco_conn_lock(sco_pi(sk)->conn); - hci_conn_drop(sco_pi(sk)->conn->hcon); sco_pi(sk)->conn->hcon = NULL; sco_conn_unlock(sco_pi(sk)->conn); + hci_conn_put(hcon); } else sco_chan_del(sk, ECONNRESET); break;