[PATCH OLK-6.6] Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb()
From: Siwei Zhang <oss@fourdim.xyz> stable inclusion from stable-v6.6.140 commit 5105f3e6b2df619c635b5f6a49fac131a36c7952 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/15079 CVE: CVE-2026-45834 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- commit 2ff1a41a912de8517b4482e946dd951b7d80edbf upstream. Add the same NULL guard already present in l2cap_sock_resume_cb() and l2cap_sock_ready_cb(). Fixes: 89bc500e41fc ("Bluetooth: Add state tracking to struct l2cap_chan") Cc: stable@kernel.org Signed-off-by: Siwei Zhang <oss@fourdim.xyz> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Chen Jinghuang <chenjinghuang2@huawei.com> --- net/bluetooth/l2cap_sock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 7c87741a3d9e..2fcac3e28c7a 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1617,6 +1617,9 @@ static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state, { struct sock *sk = chan->data; + if (!sk) + return; + sk->sk_state = state; if (err) -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/23181 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/54R... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/23181 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/54R...
participants (2)
-
Chen Jinghuang -
patchwork bot