]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fuse: reject internal errno
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 22 Jun 2021 07:15:35 +0000 (09:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:21:08 +0000 (16:21 +0200)
commit 49221cf86d18bb66fe95d3338cb33bd4b9880ca5 upstream.

Don't allow userspace to report errors that could be kernel-internal.

Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Fixes: 334f485df85a ("[PATCH] FUSE - device functions")
Cc: <stable@vger.kernel.org> # v2.6.14
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/dev.c

index d665f9f20d3c886305a134244a0467be5cf77d47..d21e41735805d532652cabc25352ad6578e45e26 100644 (file)
@@ -1883,7 +1883,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
        }
 
        err = -EINVAL;
-       if (oh.error <= -1000 || oh.error > 0)
+       if (oh.error <= -512 || oh.error > 0)
                goto err_finish;
 
        spin_lock(&fpq->lock);