[PATCH 4.19 283/421] fuse: reject internal errno

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-07-19 16:26:52
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-07-19
From: Miklos Szeredi <redacted>

commit 49221cf86d18bb66fe95d3338cb33bd4b9880ca5 upstream.

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

Reported-by: Anatoly Trosinenko <redacted>
Fixes: 334f485df85a ("[PATCH] FUSE - device functions")
Cc: <redacted> # v2.6.14
Signed-off-by: Miklos Szeredi <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/fuse/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1896,7 +1896,7 @@ static ssize_t fuse_dev_do_write(struct
 	}
 
 	err = -EINVAL;
-	if (oh.error <= -1000 || oh.error > 0)
+	if (oh.error <= -512 || oh.error > 0)
 		goto err_finish;
 
 	spin_lock(&fpq->lock);

Thread (423 messages) 423 messages, 2 authors, last reply 2021-07-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help