Commit b496691
NVIDIA: SAUCE: ovl: keep err zero after successful ovl_cache_get()
BugLink: https://bugs.launchpad.net/bugs/2150640
ovl_iterate_merged() stores PTR_ERR(cache) in err before checking
IS_ERR(cache). On success err holds the truncated cache pointer and
can be returned as a bogus non-zero error.
The syzbot reproducer reaches this through overlay-on-overlay readdir:
getdents64
iterate_dir(outer overlay file)
ovl_iterate_merged()
ovl_cache_get()
ovl_dir_read_merged()
ovl_dir_read()
iterate_dir(inner overlay file)
ovl_iterate_merged()
Only compute PTR_ERR(cache) on the error path.
Fixes: d25e4b7 ("ovl: refactor ovl_iterate() and port to cred guard")
Reported-by: syzbot+a16fb0cce329a320661c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a16fb0cce329a320661c
Cc: stable@vger.kernel.org
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Acked-by: Jamie Nguyen <jamien@nvidia.com>
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
Acked-by: Carol L Soto <csoto@nvidia.com>
(backported from https://lore.kernel.org/r/20260514144258.3068715-1-nirmoyd@nvidia.com)
Signed-off-by: Brad Figg <bfigg@nvidia.com>1 parent f8bb555 commit b496691
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
| 841 | + | |
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
848 | 847 | | |
849 | | - | |
| 848 | + | |
850 | 849 | | |
851 | 850 | | |
852 | 851 | | |
| |||
869 | 868 | | |
870 | 869 | | |
871 | 870 | | |
872 | | - | |
| 871 | + | |
873 | 872 | | |
874 | 873 | | |
875 | 874 | | |
| |||
0 commit comments