]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: algif_aead - skip SGL entries with NULL page
authorStephan Mueller <smueller@chronox.de>
Fri, 10 Nov 2017 10:04:52 +0000 (11:04 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Nov 2017 05:23:36 +0000 (13:23 +0800)
commit8e1fa89aa8bc2870009b4486644e4a58f2e2a4f5
tree30fc1296d5e3ac84f5f2e6642ad5b172535140b6
parent1d9ddde12e3c9bab7f3d3484eb9446315e3571ca
crypto: algif_aead - skip SGL entries with NULL page

The TX SGL may contain SGL entries that are assigned a NULL page. This
may happen if a multi-stage AIO operation is performed where the data
for each stage is pointed to by one SGL entry. Upon completion of that
stage, af_alg_pull_tsgl will assign NULL to the SGL entry.

The NULL cipher used to copy the AAD from TX SGL to the destination
buffer, however, cannot handle the case where the SGL starts with an SGL
entry having a NULL page. Thus, the code needs to advance the start
pointer into the SGL to the first non-NULL entry.

This fixes a crash visible on Intel x86 32 bit using the libkcapi test
suite.

Cc: <stable@vger.kernel.org>
Fixes: 72548b093ee38 ("crypto: algif_aead - copy AAD from src to dst")
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_aead.c