Commit 52cf247
nfsd: encoders mustn't use unitialized values in error cases
commit f961e3f2acae94b727380c0b74e2d3954d0edf79 upstream.
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>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent da922dc commit 52cf247
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4041 | 4041 | | |
4042 | 4042 | | |
4043 | 4043 | | |
4044 | | - | |
4045 | | - | |
| 4044 | + | |
4046 | 4045 | | |
4047 | 4046 | | |
4048 | 4047 | | |
| |||
4059 | 4058 | | |
4060 | 4059 | | |
4061 | 4060 | | |
| 4061 | + | |
4062 | 4062 | | |
4063 | 4063 | | |
4064 | 4064 | | |
| |||
4111 | 4111 | | |
4112 | 4112 | | |
4113 | 4113 | | |
4114 | | - | |
4115 | | - | |
| 4114 | + | |
4116 | 4115 | | |
4117 | 4116 | | |
4118 | 4117 | | |
| |||
4135 | 4134 | | |
4136 | 4135 | | |
4137 | 4136 | | |
| 4137 | + | |
4138 | 4138 | | |
4139 | 4139 | | |
4140 | 4140 | | |
| |||
0 commit comments