nfsd: preflight SEQUENCE replies before accepting a slot
NIST has received this entry but not started reviewing it.
In the Linux kernel, the following vulnerability has been resolved: nfsd: preflight SEQUENCE replies before accepting a slot nfsd4_sequence() narrows the reply buffer to the session's cached reply limit before it accepts the slot seqid. A client may negotiate ca_maxresponsesize_cached down to NFSD_MIN_HDR_SEQ_SZ, and nfsd4_alloc_slot() then gives every slot a zero-length sl_data[]. A COMPOUND tag can fill that narrowed buffer until it holds the SEQUENCE opcode but not the status word that follows. nfsd4_encode_operation() returns without running nfsd4_encode_sequence(), so cstate.data_offset stays zero. It leaves op->status at nfs_ok as well, so the COMPOUND is treated as having succeeded. nfsd4_store_cache_entry() declines to cache a lone SEQUENCE that returned an error. That test reads the status the operation reported, so it passes here. The copy starts at offset zero and takes the whole reply, RPC and COMPOUND headers included, into the zero-length sl_data[]. The COMPOUND tag is copied along with it, so the client picks most of the bytes written past the end of the slot: BUG: KASAN: slab-out-of-bounds in read_bytes_from_xdr_buf+0x1bc/0x390 Write of size 80 at addr ffff888003a549cd by task kunit_try_catch/24 __asan_memcpy+0x38/0x60 read_bytes_from_xdr_buf+0x1bc/0x390 nfsd4_sequence_done+0x5b0/0x810 nfs4svc_encode_compoundres+0x1bf/0x240 Check that the fixed-size SEQUENCE result, plus room for a following operation's error status, fits the negotiated limit before narrowing the buffer and consuming the slot seqid. The slot and its reply cache are left unchanged, as RFC 8881 Section 2.10.6.1.2 requires of an error returned from SEQUENCE.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 2 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Linux Linux | Software | from 47ee52986472dba068e8223cbaf1b65d74238781, before aff12e327620258123f847d7d06565f4555c5cb4; from 47ee52986472dba068e8223cbaf1b65d74238781, before 6a26c5473bb112d8420ffd48d5331bc5fb5a2065; from 47ee52986472dba068e8223cbaf1b65d74238781, before fa85acf074f000ad3d1a5ffb703128ff97de983d; from 47ee52986472dba068e8223cbaf1b65d74238781, before cd303eb29cf34a6780f4c42aca5b8ca4a05a5d59; from 47ee52986472dba068e8223cbaf1b65d74238781, before 1a5a227bca6a8a9f9d31230697aeb84c62a21da6; from 47ee52986472dba068e8223cbaf1b65d74238781, before 37fc2ec211630360e9aefcaaec8730db964645f2; and 2 more | aff12e327620258123f847d7d06565f4555c5cb4; 6a26c5473bb112d8420ffd48d5331bc5fb5a2065; fa85acf074f000ad3d1a5ffb703128ff97de983d; cd303eb29cf34a6780f4c42aca5b8ca4a05a5d59 |
| Linux Linux | Software | 3.16 | not recorded |
The 9.8 severity score (critical) from the company that reported it, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | Network | Can be attacked from anywhere on the internet, with no need to be near the target. |
| How hard it is | Low | Easy to carry out. No special conditions have to line up. |
| Login needed | None | The attacker does not need an account or password. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Reaches beyond the program | Unchanged | The damage stays inside the vulnerable program. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | High | The attacker can take the service down completely. |
| Ease of attack | 3.9 | A score for how easy it is to use the flaw. Higher is easier. |
| Damage | 5.9 | A score for how bad the harm is if it works. Higher is worse. |
NIST lists 9 sources for this flaw, none tagged as a vendor patch.