• Ard Biesheuvel's avatar
    crypto: aesni - prevent misaligned buffers on the stack · a13ed1d1
    Ard Biesheuvel authored
    The GCM mode driver uses 16 byte aligned buffers on the stack to pass
    the IV to the asm helpers, but unfortunately, the x86 port does not
    guarantee that the stack pointer is 16 byte aligned upon entry in the
    first place. Since the compiler is not aware of this, it will not emit
    the additional stack realignment sequence that is needed, and so the
    alignment is not guaranteed to be more than 8 bytes.
    
    So instead, allocate some padding on the stack, and realign the IV
    pointer by hand.
    
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    a13ed1d1
aesni-intel_glue.c 36.9 KB