Commit 09b6c08
Bluetooth: Fix debugfs NULL pointer dereference
[ Upstream commit 30d65e0 ]
Fix crash caused by NULL pointer dereference when debugfs functions
le_max_key_read, le_max_key_size_write, le_min_key_size_read or
le_min_key_size_write and Bluetooth adapter was powered off.
Fix is to move max_key_size and min_key_size from smp_dev to hci_dev.
At the same time they were renamed to le_max_key_size and
le_min_key_size.
BUG: unable to handle kernel NULL pointer dereference at 00000000000002e8
PGD 0 P4D 0
Oops: 0000 [#24] SMP PTI
CPU: 2 PID: 6255 Comm: cat Tainted: G D OE 4.18.9-200.fc28.x86_64 #1
Hardware name: LENOVO 4286CTO/4286CTO, BIOS 8DET76WW (1.46 ) 06/21/2018
RIP: 0010:le_max_key_size_read+0x45/0xb0 [bluetooth]
Code: 00 00 00 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 44 24 08 31 c0 48 8b 87 c8 00 00 00 48 8d 7c 24 04 48 8b 80 48 0a 00 00 <48> 8b 80 e8 02 00 00 0f b6 48 52 e8 fb b6 b3 ed be 04 00 00 00 48
RSP: 0018:ffffab23c3ff3df0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00007f0b4ca2e000 RCX: ffffab23c3ff3f08
RDX: ffffffffc0ddb033 RSI: 0000000000000004 RDI: ffffab23c3ff3df4
RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffab23c3ff3ed8 R11: 0000000000000000 R12: ffffab23c3ff3f08
R13: 00007f0b4ca2e000 R14: 0000000000020000 R15: ffffab23c3ff3f08
FS: 00007f0b4ca0f540(0000) GS:ffff91bd5e280000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000002e8 CR3: 00000000629fa006 CR4: 00000000000606e0
Call Trace:
full_proxy_read+0x53/0x80
__vfs_read+0x36/0x180
vfs_read+0x8a/0x140
ksys_read+0x4f/0xb0
do_syscall_64+0x5b/0x160
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Signed-off-by: Matias Karhumaa <matias.karhumaa@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6496b96 commit 09b6c08
File tree
3 files changed
+13
-14
lines changed- include/net/bluetooth
- net/bluetooth
3 files changed
+13
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3084 | 3084 | | |
3085 | 3085 | | |
3086 | 3086 | | |
| 3087 | + | |
| 3088 | + | |
3087 | 3089 | | |
3088 | 3090 | | |
3089 | 3091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| |||
720 | 717 | | |
721 | 718 | | |
722 | 719 | | |
723 | | - | |
| 720 | + | |
724 | 721 | | |
725 | 722 | | |
726 | 723 | | |
| |||
731 | 728 | | |
732 | 729 | | |
733 | 730 | | |
734 | | - | |
| 731 | + | |
735 | 732 | | |
736 | 733 | | |
737 | 734 | | |
| |||
745 | 742 | | |
746 | 743 | | |
747 | 744 | | |
748 | | - | |
| 745 | + | |
749 | 746 | | |
750 | 747 | | |
751 | 748 | | |
| |||
3264 | 3261 | | |
3265 | 3262 | | |
3266 | 3263 | | |
3267 | | - | |
3268 | | - | |
3269 | 3264 | | |
3270 | 3265 | | |
3271 | 3266 | | |
| |||
3391 | 3386 | | |
3392 | 3387 | | |
3393 | 3388 | | |
3394 | | - | |
| 3389 | + | |
3395 | 3390 | | |
3396 | 3391 | | |
3397 | 3392 | | |
| |||
3412 | 3407 | | |
3413 | 3408 | | |
3414 | 3409 | | |
3415 | | - | |
| 3410 | + | |
3416 | 3411 | | |
3417 | 3412 | | |
3418 | 3413 | | |
3419 | | - | |
| 3414 | + | |
3420 | 3415 | | |
3421 | 3416 | | |
3422 | 3417 | | |
| |||
3435 | 3430 | | |
3436 | 3431 | | |
3437 | 3432 | | |
3438 | | - | |
| 3433 | + | |
3439 | 3434 | | |
3440 | 3435 | | |
3441 | 3436 | | |
| |||
3457 | 3452 | | |
3458 | 3453 | | |
3459 | 3454 | | |
3460 | | - | |
| 3455 | + | |
3461 | 3456 | | |
3462 | 3457 | | |
3463 | | - | |
| 3458 | + | |
3464 | 3459 | | |
3465 | 3460 | | |
3466 | 3461 | | |
| |||
0 commit comments