Skip to content

Commit 77a28aa

Browse files
committed
ovl: relax WARN_ON in ovl_verify_area()
syzbot hit an assertion in copy up data loop which looks like it is the result of a lower file whose size is being changed underneath overlayfs. This type of use case is documented to cause undefined behavior, so returning EIO error for the copy up makes sense, but it should not be causing a WARN_ON assertion. Reported-and-tested-by: [email protected] Fixes: ca7ab48 ("ovl: add permission hooks outside of do_splice_direct()") Signed-off-by: Amir Goldstein <[email protected]>
1 parent 1b17f39 commit 77a28aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/overlayfs/copy_up.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ static int ovl_verify_area(loff_t pos, loff_t pos2, loff_t len, loff_t totlen)
234234
{
235235
loff_t tmp;
236236

237-
if (WARN_ON_ONCE(pos != pos2))
237+
if (pos != pos2)
238238
return -EIO;
239-
if (WARN_ON_ONCE(pos < 0 || len < 0 || totlen < 0))
239+
if (pos < 0 || len < 0 || totlen < 0)
240240
return -EIO;
241-
if (WARN_ON_ONCE(check_add_overflow(pos, len, &tmp)))
241+
if (check_add_overflow(pos, len, &tmp))
242242
return -EIO;
243243
return 0;
244244
}

0 commit comments

Comments
 (0)