• Eric Biggers's avatar
    crypto: lrw - use correct alignmask · 20a0f976
    Eric Biggers authored
    Commit c778f96b ("crypto: lrw - Optimize tweak computation")
    incorrectly reduced the alignmask of LRW instances from
    '__alignof__(u64) - 1' to '__alignof__(__be32) - 1'.
    
    However, xor_tweak() and setkey() assume that the data and key,
    respectively, are aligned to 'be128', which has u64 alignment.
    
    Fix the alignmask to be at least '__alignof__(be128) - 1'.
    
    Fixes: c778f96b ("crypto: lrw - Optimize tweak computation")
    Cc: <stable@vger.kernel.org> # v4.20+
    Cc: Ondrej Mosnacek <omosnace@redhat.com>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    20a0f976
lrw.c 10.9 KB