Bluetooth: L2CAP: Reject mode changes on connected channels
Subsystems (2)
PATCH 1/1 Bluetooth: L2CAP: Reject mode changes on connected channels
Allowing mode changes on already-connected channel will skip necessary initialization on the new mode, resulting NULL ptr dereference.
---
Please apply https://lore.kernel.org/linux-bluetooth/[email protected]/
as well, thank you.
net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +2 -1
@@ -3876,7 +3876,8 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, } } -if (chan->mode ==L2CAP_MODE_BASIC && chan->mode != rfc.mode) +if ((chan->mode ==L2CAP_MODE_BASIC || chan->state ==BT_CONNECTED ) && + chan->mode != rfc.mode)return -ECONNREFUSED ; chan->mode = rfc.mode;
Signature · 1 line
2.55.0
Quoted 7 lines · Siwei Zhang
Allowing mode changes on already-connected channel will skip necessary initialization on the new mode, resulting NULL ptr dereference.
Cc: [email protected]
Closes:
https://sashiko.dev/#/patchset/20261007144717.3832330-1-oss%40fourdim.xyz
Quoted 7 lines
Fixes f2fcfcd67025 ("Bluetooth: Add configuration support for ERTM andStreaming mode")
Signed-off-by Siwei Zhang <[email protected]>---
Please apply
https://lore.kernel.org/linux-bluetooth/[email protected]/
as well, thank you.
Hi all,
Please don't apply it for now.
There will be some more commits to add and be turning into a patch series. This will be the first commit.
Thank you.
Best,
Siwei
Quoted 21 lines
net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/bluetooth/l2cap_core.c +2
-1@@ -3876,7 +3876,8 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, } } -if (chan->mode ==L2CAP_MODE_BASIC && chan->mode != rfc.mode) +if ((chan->mode ==L2CAP_MODE_BASIC || chan->state ==BT_CONNECTED ) && + chan->mode != rfc.mode)return -ECONNREFUSED ;
chan->mode= rfc.mode;Signature · 1 line
2.55.0
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/series/1181680/
---Test result---
Test Summary:
CheckPatch PASS 0.73 seconds VerifyFixes PASS 0.44 seconds VerifySignedoff PASS 0.13 seconds GitLint PASS 0.32 seconds SubjectPrefix PASS 0.12 seconds BuildKernel PASS 29.10 seconds CheckAllWarning PASS 32.91 seconds CheckSparse PASS 35.56 seconds BuildKernel32 PASS 28.89 seconds CheckKernelLLVM PASS 34.86 seconds TestRunnerSetup PASS 767.82 seconds TestRunner_l2cap-tester PASS 12.53 seconds IncrementalBuild PASS 27.63 seconds
https://github.com/bluez/bluetooth-next/pull/889
---
Regards,
Linux Bluetooth