]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: af_alg - Fix page reassignment overflow in af_alg_pull_tsgl
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 4 Apr 2026 00:29:58 +0000 (08:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Apr 2026 11:30:43 +0000 (13:30 +0200)
commit9532501e0f1b200ea80baa0e33e0b06da10bb271
tree313b526595ecac4a97ad4bde48be7ead4403a1a7
parenta431ddd97ab67d65f6c847d3eb4edf6d582d6675
crypto: af_alg - Fix page reassignment overflow in af_alg_pull_tsgl

[ Upstream commit 31d00156e50ecad37f2cb6cbf04aaa9a260505ef ]

When page reassignment was added to af_alg_pull_tsgl the original
loop wasn't updated so it may try to reassign one more page than
necessary.

Add the check to the reassignment so that this does not happen.

Also update the comment which still refers to the obsolete offset
argument.

Reported-by: syzbot+d23888375c2737c17ba5@syzkaller.appspotmail.com
Fixes: e870456d8e7c ("crypto: algif_skcipher - overhaul memory management")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/af_alg.c