Commit 94d95ac
Marios Makassikis
ksmbd: smb1: add buffer validation
Many functions assume the client sends well formed packets, or are
optimistic about the buffer length (using PATH_MAX or a fixed '256'
value) instead of the actual length.
The pattern followed to fix this boils down to extracting the total
buffer length and calculate how much data has been consumed.
Signed-off-by: Marios Makassikis <[email protected]>1 parent 9df0f70 commit 94d95ac
3 files changed
+398
-187
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | | - | |
| 338 | + | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
343 | 350 | | |
344 | 351 | | |
345 | 352 | | |
| |||
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
604 | | - | |
| 611 | + | |
605 | 612 | | |
606 | 613 | | |
607 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments