]> git.baikalelectronics.ru Git - 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)
commit0e6ff50bf482bbb84d0e0cc5e8a14dd3698fdbfd
tree30fc1296d5e3ac84f5f2e6642ad5b172535140b6
parente16680e6554f757815754ae2cea2d6b978b09efd
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: 9322209c80c20 ("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