• Ondrej Mosnáček's avatar
    crypto: skcipher - Fix skcipher_walk_aead_common · c14ca838
    Ondrej Mosnáček authored
    The skcipher_walk_aead_common function calls scatterwalk_copychunks on
    the input and output walks to skip the associated data. If the AD end
    at an SG list entry boundary, then after these calls the walks will
    still be pointing to the end of the skipped region.
    These offsets are later checked for alignment in skcipher_walk_next,
    so the skcipher_walk may detect the alignment incorrectly.
    This patch fixes it by calling scatterwalk_done after the copychunks
    calls to ensure that the offsets refer to the right SG list entry.
    Fixes: b286d8b1 ("crypto: skcipher - Add skcipher walk interface")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarOndrej Mosnacek <omosnacek@gmail.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
skcipher.c 25.9 KB