• Stephan Mueller's avatar
    crypto: algif_aead - skip SGL entries with NULL page · 8e1fa89a
    Stephan Mueller authored
    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: 72548b09 ("crypto: algif_aead - copy AAD from src to dst")
    Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    8e1fa89a
algif_aead.c 15.9 KB