]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net/9p: Check errno validity
authorSimon Derr <simon.derr@bull.net>
Fri, 10 Aug 2012 13:52:06 +0000 (15:52 +0200)
committerEric Van Hensbergen <ericvh@gmail.com>
Thu, 6 Sep 2012 18:54:55 +0000 (13:54 -0500)
commit43def35c1030d91a7414936c7c1b416828b20afb
tree58e6a3f765f7319c91abf45978c34c60f188b9ee
parentba413ab2ccc49e6aa1ebc3523a75635b5e4a0494
net/9p: Check errno validity

While working on a modified server I had the Linux clients crash
a few times. This lead me to find this:

Some error codes are directly extracted from the server replies.
A malformed server reply could contain an invalid error code, with a
very large value. If this value is then passed to ERR_PTR() it will
not be properly detected as an error code by IS_ERR() and as a result
the kernel will dereference an invalid pointer.

This patch tries to avoid this.

Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p/client.c