Actions
Bug #9263
closed
VJ
VJ
nfs/smb: the read/write queue limits do not hold to the record
Bug #9263:
nfs/smb: the read/write queue limits do not hold to the record
Affected Versions:
Effort:
Difficulty:
Label:
Description
Description¶
The queue limits added for #8791 (NFS) and #8789 (SMB1) rely on bookkeeping that does not stay within the record carrying the data:
- NFS: the record tail and the chunk promise come from the declared size, not the record. A padded or segmented record leaves a promise armed past its end: a continuation reads into the next RPC, record slack grows the out-of-order queue, and a file whose queued data fits is truncated.
- NFS v3: WRITE request and READ reply arguments are trusted to fit their record. A claim below the parsed extent lets file data run into the next RPC, which is then parsed as a record.
- NFS: the partial-record scanner misreads RPCSEC_GSS records other than the integrity service, and OPEN claim types 2 and 3. It buffers toward the claim or rejects records that parse fine.
- NFS: partial LOOKUP, READDIRPLUS and CREATE replies are bounded by
max-read-size, so the handle-to-name mapping depends on that setting and on segmentation. - SMB: the file-data backstop runs only on gapped streams, so out-of-order data on a stream without gaps grows the queue past its bound. A rejected record still arms a file-data promise.
- A
max-txof 0 is accepted for NFS and SMB and evicts every transaction. SMB size settings above u32 are silently truncated.
Expected behaviour¶
Nothing runs past its record marker, and the queue bounds hold with and without gaps.
Affected versions¶
master and 8.0.x.
Possible fix¶
Take the promise and the tail from the record; check v3 claims against the record; scan GSS records by their credential combination and OPEN claims by type; give metadata replies their own max-metadata-size; run the SMB backstop whenever an update carries data; reject a max-tx of 0.
Related: #8791, #8789.
Actions