mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
fanotify: remove unneeded sub-zero check for unsigned value
Unsigned size_t len in copy_fid_info_to_user is checked
for negative value. This check is redundant as it is
always false.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 5e469c830f
("fanotify: copy event fid info to user")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <d296ff1c-dcf7-4813-994b-3c4369debb7d@ancud.ru>
This commit is contained in:
parent
4cece76496
commit
e659522446
@ -502,7 +502,7 @@ static int copy_fid_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fh *fh,
|
||||
}
|
||||
|
||||
/* Pad with 0's */
|
||||
WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
|
||||
WARN_ON_ONCE(len >= FANOTIFY_EVENT_ALIGN);
|
||||
if (len > 0 && clear_user(buf, len))
|
||||
return -EFAULT;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user