]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
filldir[64]: remove WARN_ON_ONCE() for bad directory entries
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Oct 2019 22:41:16 +0000 (18:41 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:47:27 +0000 (23:47 -0500)
BugLink: https://bugs.launchpad.net/bugs/1860602
commit b9959c7a347d6adbb558fba7e36e9fef3cba3b07 upstream.

This was always meant to be a temporary thing, just for testing and to
see if it actually ever triggered.

The only thing that reported it was syzbot doing disk image fuzzing, and
then that warning is expected.  So let's just remove it before -rc4,
because the extra sanity testing should probably go to -stable, but we
don't want the warning to do so.

Reported-by: syzbot+3031f712c7ad5dd4d926@syzkaller.appspotmail.com
Fixes: 8a23eb804ca4 ("Make filldir[64]() verify the directory entry filename is valid")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/readdir.c

index 45a4284a52c34a913a7ee0880dfbbc2334447470..710f94355f9cfa1ece9f92a077ad9389f9a4eb63 100644 (file)
@@ -91,9 +91,9 @@ EXPORT_SYMBOL(iterate_dir);
  */
 static int verify_dirent_name(const char *name, int len)
 {
-       if (WARN_ON_ONCE(!len))
+       if (!len)
                return -EIO;
-       if (WARN_ON_ONCE(memchr(name, '/', len)))
+       if (memchr(name, '/', len))
                return -EIO;
        return 0;
 }