Commit 02f76c4
ksmbd: fix global-out-of-bounds in smb2_find_context_vals
Add tag_len argument in smb2_find_context_vals() to avoid out-of-bound
read when create_context's name_len is larger than tag length.
[ 7.995411] ==================================================================
[ 7.995866] BUG: KASAN: global-out-of-bounds in memcmp+0x83/0xa0
[ 7.996248] Read of size 8 at addr ffffffff8258d940 by task kworker/0:0/7
...
[ 7.998191] Call Trace:
[ 7.998358] <TASK>
[ 7.998503] dump_stack_lvl+0x33/0x50
[ 7.998743] print_report+0xcc/0x620
[ 7.999458] kasan_report+0xae/0xe0
[ 7.999895] kasan_check_range+0x35/0x1b0
[ 8.000152] memcmp+0x83/0xa0
[ 8.000347] smb2_find_context_vals+0xf7/0x1e0
[ 8.000635] smb2_open+0x1df2/0x43a0
[ 8.006398] handle_ksmbd_work+0x274/0x810
[ 8.006666] process_one_work+0x419/0x760
[ 8.006922] worker_thread+0x2a2/0x6f0
[ 8.007429] kthread+0x160/0x190
[ 8.007946] ret_from_fork+0x1f/0x30
[ 8.008181] </TASK>
Cc: stable@vger.kernel.org
Signed-off-by: Chih-Yen Chang <cc85nod@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent f1fcbaa commit 02f76c4
3 files changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1449 | 1449 | | |
1450 | 1450 | | |
1451 | 1451 | | |
| 1452 | + | |
1452 | 1453 | | |
1453 | 1454 | | |
1454 | 1455 | | |
1455 | 1456 | | |
1456 | | - | |
| 1457 | + | |
1457 | 1458 | | |
1458 | 1459 | | |
1459 | 1460 | | |
| |||
1492 | 1493 | | |
1493 | 1494 | | |
1494 | 1495 | | |
1495 | | - | |
| 1496 | + | |
1496 | 1497 | | |
1497 | 1498 | | |
1498 | 1499 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2464 | 2464 | | |
2465 | 2465 | | |
2466 | 2466 | | |
2467 | | - | |
| 2467 | + | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | 2470 | | |
| |||
2666 | 2666 | | |
2667 | 2667 | | |
2668 | 2668 | | |
2669 | | - | |
| 2669 | + | |
2670 | 2670 | | |
2671 | 2671 | | |
2672 | 2672 | | |
| |||
2686 | 2686 | | |
2687 | 2687 | | |
2688 | 2688 | | |
2689 | | - | |
| 2689 | + | |
2690 | 2690 | | |
2691 | 2691 | | |
2692 | 2692 | | |
| |||
2697 | 2697 | | |
2698 | 2698 | | |
2699 | 2699 | | |
2700 | | - | |
| 2700 | + | |
2701 | 2701 | | |
2702 | 2702 | | |
2703 | 2703 | | |
| |||
2709 | 2709 | | |
2710 | 2710 | | |
2711 | 2711 | | |
2712 | | - | |
| 2712 | + | |
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| |||
3107 | 3107 | | |
3108 | 3108 | | |
3109 | 3109 | | |
3110 | | - | |
| 3110 | + | |
3111 | 3111 | | |
3112 | 3112 | | |
3113 | 3113 | | |
| |||
3134 | 3134 | | |
3135 | 3135 | | |
3136 | 3136 | | |
3137 | | - | |
| 3137 | + | |
3138 | 3138 | | |
3139 | 3139 | | |
3140 | 3140 | | |
| |||
0 commit comments