]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: encoders mustn't use unitialized values in error cases
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 5 May 2017 20:17:57 +0000 (16:17 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 10 May 2017 18:25:19 +0000 (14:25 -0400)
commit6918e6f8e773e49b0a673a362f9cf2f458086c40
treede0fd2594a2efeaa34bdefff2880ef9824975cf3
parentbd34f12e89bcfeb5b1c39d4cdfcb7a32024c357c
nfsd: encoders mustn't use unitialized values in error cases

In error cases, lgp->lg_layout_type may be out of bounds; so we
shouldn't be using it until after the check of nfserr.

This was seen to crash nfsd threads when the server receives a LAYOUTGET
request with a large layout type.

GETDEVICEINFO has the same problem.

Reported-by: Ari Kauppi <Ari.Kauppi@synopsys.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c