History

knfsd: Allow NFSv2/3 WRITE calls to succeed when krb5i etc is used.

When RPCSEC/GSS and krb5i is used, requests are padded, typically to a multiple of 8 bytes. This can make the request look slightly longer than it really is. As of f34b95689d2ce001c "The NFSv2/NFSv3 server does not handle zero length WRITE request correctly", the xdr decode routines for NFSv2 and NFSv3 reject requests that aren't the right length, so krb5i (for example) WRITE requests can get lost. This patch relaxes the appropriate test and enhances the related comment.

NeilBrown committed 18 years ago

Commit ba67a391 parent 84427ea2 files · +8 −2Browse files

Unified · Split

2 files
  1. fs/nfsd/nfs3xdr.c +4 −1
  2. fs/nfsd/nfsxdr.c +4 −1
fs/nfsd/nfs3xdr.c+4−1
@@ -388,8 +388,11 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, · 387 unmodified lines
388 * Round the length of the data which was specified up to388 * Round the length of the data which was specified up to
389 * the next multiple of XDR units and then compare that389 * the next multiple of XDR units and then compare that
390 * against the length which was actually received.390 * against the length which was actually received.
391 * Note that when RPCSEC/GSS (for example) is used, the
392 * data buffer can be padded so dlen might be larger
393 * than required. It must never be smaller.
391 */394 */
392 if (dlen != XDR_QUADLEN(len)*4)395 if (dlen < XDR_QUADLEN(len)*4)
393 return 0;396 return 0;
394 397
395 if (args->count > max_blocksize) {398 if (args->count > max_blocksize) {
fs/nfsd/nfsxdr.c+4−1
@@ -313,8 +313,11 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, · 312 unmodified lines
313 * Round the length of the data which was specified up to313 * Round the length of the data which was specified up to
314 * the next multiple of XDR units and then compare that314 * the next multiple of XDR units and then compare that
315 * against the length which was actually received.315 * against the length which was actually received.
316 * Note that when RPCSEC/GSS (for example) is used, the
317 * data buffer can be padded so dlen might be larger
318 * than required. It must never be smaller.
316 */319 */
317 if (dlen != XDR_QUADLEN(len)*4)320 if (dlen < XDR_QUADLEN(len)*4)
318 return 0;321 return 0;
319 322
320 rqstp->rq_vec[0].iov_base = (void*)p;323 rqstp->rq_vec[0].iov_base = (void*)p;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t