]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
nfsd: catch errors in decode_fattr earlier
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 10 Jun 2016 20:56:05 +0000 (16:56 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 1 Nov 2016 19:47:52 +0000 (15:47 -0400)
commite864c189e1d63f2f6a052e296f0da0616d88b625
tree9b88ed7ea2af0d4bde7b58dabf8bcba748e345ba
parent916d2d844afd09dc8cf144e0e9dc98daa9dfc34a
nfsd: catch errors in decode_fattr earlier

3c8e03166ae2 "NFSv4: do exact check about attribute specified" fixed
some handling of unsupported-attribute errors, but it also delayed
checking for unwriteable attributes till after we decode them.  This
could lead to odd behavior in the case a client attemps to set an
attribute we don't know about followed by one we try to parse.  In that
case the parser for the known attribute will attempt to parse the
unknown attribute.  It should fail in some safe way, but the error might
at least be incorrect (probably bad_xdr instead of inval).  So, it's
better to do that check at the start.

As far as I know this doesn't cause any problems with current clients
but it might be a minor issue e.g. if we encounter a future client that
supports a new attribute that we currently don't.

Cc: Yu Zhiguo <yuzg@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c
fs/nfsd/nfsd.h