summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorDaehyeon Ko <4ncienth@gmail.com>2026-10-04 14:09:46 +0900
committerHerbert Xu <herbert@gondor.apana.org.au>2026-10-08 18:48:07 +1100
commit2f90facc7b94934653eb7ebfadcc25d503b89196 (patch)
tree756c759ee95bc8cbe841200575fb73d17757c51d /include/uapi/linux
parent80fb9a85807177d3ca64746d59a68b1c6e8f20a6 (diff)
downloadlinux-next-2f90facc7b94934653eb7ebfadcc25d503b89196.tar.gz
linux-next-2f90facc7b94934653eb7ebfadcc25d503b89196.zip
crypto: algif_skcipher - rewind rounded output bytes
af_alg_get_rsgl() advances the receive iterator by the unrounded RX scatterlist length. For a continuing skcipher request, _skcipher_recvmsg() then rounds its local length down to a whole chunksize without restoring the iterator. A later chunk starts after bytes which the provider never wrote, while the syscall returns only the processed length. When copy_splice_read() supplies non-zeroed pages and publishes that return as a dense prefix, the gap exposes stale bytes from a previous page lifetime. With unprivileged xts(aes), a 31-byte MSG_MORE request followed by one final byte advances a 47-byte destination while returning 32 bytes. A hardened v7.2-rc5 image retained all 15 seeded stale bytes in 4,829 of 4,829 records. With init_on_alloc enabled, all 72,345 gap bytes observed were zero. Rewind the iterator by the tail excluded during rounding, before rejecting a zero processed length. The crypto request uses only the rounded length; af_alg_free_resources() releases the entire RX list before another receive iteration. The fixed target-like kernel returned byte-identical dense 48-byte output in 4,771 of 4,771 rounds. The unmodified kernel returned the vulnerable 32-byte short record in 2,409 of 2,409 rounds. Fixes: e870456d8e7c ("crypto: algif_skcipher - overhaul memory management") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Daehyeon Ko <4ncienth@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions