summaryrefslogtreecommitdiff
path: root/net/9p/error.c
diff options
context:
space:
mode:
authorAbhishek Kulkarni <adkulkar@umail.iu.edu>2009-08-18 01:38:45 +0400
committerEric Van Hensbergen <ericvh@gmail.com>2009-08-18 01:39:54 +0400
commit0aad37ef3deed118d3816e1d1a600eb2ec9dcb87 (patch)
treecbcfe9f449f57cd35d0ce262e5287da4f8476f30 /net/9p/error.c
parent48559b4c30708ebdc849483da9fb83ee08c6c908 (diff)
downloadlinux-0aad37ef3deed118d3816e1d1a600eb2ec9dcb87.tar.xz
net/9p: insulate the client against an invalid error code sent by a 9p server
A looney tunes server sending an invalid error code (which is !IS_ERR_VALUE) can result in a client oops. So fix it by adding a check and converting unknown or invalid error codes to -ESERVERFAULT. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/error.c')
-rw-r--r--net/9p/error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/9p/error.c b/net/9p/error.c
index fdebe4314062..52518512a93e 100644
--- a/net/9p/error.c
+++ b/net/9p/error.c
@@ -239,7 +239,7 @@ int p9_errstr2errno(char *errstr, int len)
errstr[len] = 0;
printk(KERN_ERR "%s: server reported unknown error %s\n",
__func__, errstr);
- errno = 1;
+ errno = ESERVERFAULT;
}
return -errno;