Lire la description complète
Dans le noyau Linux, la vulnérabilité suivante a été corrigée : nfsd : vérification préalable des réponses SEQUENCE avant l'acceptation d'un slot La fonction nfsd4_sequence() limite la taille du tampon de réponse à la limite de réponse mise en cache de la session avant d'accepter le seqid du slot. Un client peut négocier la valeur ca_maxresponsesize_cached jusqu’à NFSD_MIN_HDR_SEQ_SZ, et nfsd4_alloc_slot() attribue alors à chaque slot un sl_data[] de longueur nulle. Une balise COMPOUND peut remplir ce tampon réduit jusqu’à ce qu’il contienne l’ opcode SEQUENCE, mais pas le mot d’état qui suit. nfsd4_encode_operation() retourne sans exécuter nfsd4_encode_sequence(), de sorte que cstate.data_offset reste à zéro. Cela laisse également op->status à nfs_ok, de sorte que la commande COMPOUND est considérée comme ayant réussi. nfsd4_store_cache_entry() refuse de mettre en cache une commande SEQUENCE isolée qui a renvoyé une erreur. Ce test lit le statut signalé par l’opération, il est donc réussi ici. La copie commence à l’offset zéro et copie l’intégralité de la réponse, en-têtes RPC et COMPOUND compris, dans le tableau sl_data[] de longueur nulle. La balise COMPOUND est copiée en même temps, ce qui fait que le client récupère la plupart des octets écrits au-delà de la fin de l’emplacement : BUG : KASAN : accès hors limites du slab dans read_bytes_from_xdr_buf+0x1bc/0x390 Écriture de taille 80 à l'adresse ffff888003a549cd par la tâche 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 Vérifier que le résultat SEQUENCE de taille fixe, plus l'espace nécessaire pour l'état d'erreur d'une opération suivante, tient dans la longueur négociée li
Texte d'origine (anglais)
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 li