Commit a481c91
committed
smb: client: fix potential UAF in smb2_close_cached_fid()
JIRA: https://issues.redhat.com/browse/RHEL-114699
commit 734e996
Author: Henrique Carvalho <[email protected]>
Date: Mon Nov 3 19:52:55 2025 -0300
smb: client: fix potential UAF in smb2_close_cached_fid()
find_or_create_cached_dir() could grab a new reference after kref_put()
had seen the refcount drop to zero but before cfid_list_lock is acquired
in smb2_close_cached_fid(), leading to use-after-free.
Switch to kref_put_lock() so cfid_release() is called with
cfid_list_lock held, closing that gap.
Fixes: ebe98f1 ("cifs: enable caching of directories for which a lease is held")
Cc: [email protected]
Reported-by: Jay Shin <[email protected]>
Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]>
Signed-off-by: Henrique Carvalho <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Paulo Alcantara <[email protected]>1 parent 67ccdd5 commit a481c91
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
| 446 | + | |
| 447 | + | |
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
| |||
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
480 | | - | |
| 482 | + | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
| |||
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
489 | | - | |
| 491 | + | |
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
| |||
595 | 597 | | |
596 | 598 | | |
597 | 599 | | |
598 | | - | |
| 600 | + | |
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
| |||
761 | 763 | | |
762 | 764 | | |
763 | 765 | | |
764 | | - | |
| 766 | + | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| |||
0 commit comments