-
Notifications
You must be signed in to change notification settings - Fork 1
[PW_SID:1036498] Bluetooth: hci_core: Fix slab-use-after-free in hci_cmd_work #3235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: workflow
Are you sure you want to change the base?
Conversation
This patch adds workflow files for ci: [sync.yml] - The workflow file for scheduled work - Sync the repo with upstream repo and rebase the workflow branch - Review the patches in the patchwork and creates the PR if needed [ci.yml] - The workflow file for CI tasks - Run CI tests when PR is created Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
syzbot reported a slab-use-after-free in hci_cmd_work. The issue is that hci_send_cmd_sync() consumes the skb reference (either by passing it to the driver which frees it, or by calling kfree_skb() on error), but the skb might be accessed after the call in certain configurations or due to race conditions with the freeing process (e.g. vhci_read). Explicitly hold a reference to the skb using skb_get() before calling hci_send_cmd_sync() and release it with kfree_skb() afterwards. This ensures the skb object remains valid throughout the function call, regardless of how hci_send_cmd_sync() handles the original reference. Reported-by: syzbot+4d6b203d625d2f57d4ca@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=4d6b203d625d2f57d4ca Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
|
CheckPatch |
|
GitLint |
|
SubjectPrefix |
|
BuildKernel |
|
CheckAllWarning |
|
CheckSparse |
|
BuildKernel32 |
|
TestRunnerSetup |
|
TestRunner_l2cap-tester |
|
TestRunner_iso-tester |
|
TestRunner_bnep-tester |
|
TestRunner_mgmt-tester |
|
TestRunner_rfcomm-tester |
|
TestRunner_sco-tester |
|
TestRunner_ioctl-tester |
|
TestRunner_mesh-tester |
|
TestRunner_smp-tester |
|
TestRunner_userchan-tester |
|
IncrementalBuild |
264a7dc to
e7984f7
Compare
e7984f7 to
e352d45
Compare
syzbot reported a slab-use-after-free in hci_cmd_work.
The issue is that hci_send_cmd_sync() consumes the skb reference
(either by passing it to the driver which frees it, or by calling
kfree_skb() on error), but the skb might be accessed after the call
in certain configurations or due to race conditions with the freeing
process (e.g. vhci_read).
Explicitly hold a reference to the skb using skb_get() before calling
hci_send_cmd_sync() and release it with kfree_skb() afterwards. This
ensures the skb object remains valid throughout the function call,
regardless of how hci_send_cmd_sync() handles the original reference.
Reported-by: syzbot+4d6b203d625d2f57d4ca@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4d6b203d625d2f57d4ca
Signed-off-by: Szymon Wilczek swilczek.lx@gmail.com
net/bluetooth/hci_core.c | 3 +++
1 file changed, 3 insertions(+)