Commit c9fc777
committed
NFSD: Insulate nfsd4_encode_read_plus() from page boundaries in the encode buffer
Commit eeadcb7 ("NFSD: Simplify READ_PLUS") replaced the use of
write_bytes_to_xdr_buf(), copying what was in nfsd4_encode_read()
at the time.
However, the current code will corrupt the encoded data if the XDR
data items that are reserved early and then poked into the XDR
buffer later happen to fall on a page boundary in the XDR encoding
buffer.
__xdr_commit_encode can shift encoded data items in the encoding
buffer so that pointers returned from xdr_reserve_space() no longer
address the same part of the encoding stream.
Fixes: eeadcb7 ("NFSD: Simplify READ_PLUS")
Reviewed-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent 1a86115 commit c9fc777
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5337 | 5337 | | |
5338 | 5338 | | |
5339 | 5339 | | |
5340 | | - | |
| 5340 | + | |
| 5341 | + | |
5341 | 5342 | | |
5342 | | - | |
5343 | 5343 | | |
5344 | 5344 | | |
5345 | 5345 | | |
5346 | 5346 | | |
5347 | | - | |
5348 | | - | |
5349 | | - | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
| 5350 | + | |
5350 | 5351 | | |
5351 | 5352 | | |
5352 | 5353 | | |
| |||
5356 | 5357 | | |
5357 | 5358 | | |
5358 | 5359 | | |
5359 | | - | |
| 5360 | + | |
5360 | 5361 | | |
5361 | 5362 | | |
5362 | 5363 | | |
5363 | 5364 | | |
5364 | 5365 | | |
5365 | 5366 | | |
5366 | | - | |
5367 | | - | |
| 5367 | + | |
| 5368 | + | |
| 5369 | + | |
5368 | 5370 | | |
5369 | 5371 | | |
5370 | 5372 | | |
| |||
0 commit comments