Re: [syzbot] [isofs?] KASAN: slab-out-of-bounds Read in isofs_fh_to_parent

From: Edward Adam Davis
Date: Thu Apr 03 2025 - 22:35:18 EST


#syz test

diff --git a/fs/fhandle.c b/fs/fhandle.c
index 3e092ae6d142..a31c0291a473 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -344,7 +344,7 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
goto out_path;
}
if ((f_handle.handle_bytes > MAX_HANDLE_SZ) ||
- (f_handle.handle_bytes == 0)) {
+ (f_handle.handle_bytes < 16)) {
retval = -EINVAL;
goto out_path;
}