You need to sign in or sign up before continuing.
  • Iuliana Prodan's avatar
    crypto: caam - fix the address of the last entry of S/G · 55b3209a
    Iuliana Prodan authored
    For skcipher algorithms, the input, output HW S/G tables
    look like this: [IV, src][dst, IV]
    Now, we can have 2 conditions here:
    - there is no IV;
    - src and dst are equal (in-place encryption) and scattered
    and the error is an "off-by-one" in the HW S/G table.
    
    This issue was seen with KASAN:
    BUG: KASAN: slab-out-of-bounds in skcipher_edesc_alloc+0x95c/0x1018
    
    Read of size 4 at addr ffff000022a02958 by task cryptomgr_test/321
    
    CPU: 2 PID: 321 Comm: cryptomgr_test Not tainted
    5.6.0-rc1-00165-ge4ef8383-dirty #4
    Hardware name: LS1046A RDB Board (DT)
    Call trace:
     dump_backtrace+0x0/0x260
     show_stack+0x14/0x20
     dump_stack+0xe8/0x144
     print_address_description.isra.11+0x64/0x348
     __kasan_report+0x11c/0x230
     kasan_report+0xc/0x18
     __asan_load4+0x90/0xb0
     skcipher_edesc_alloc+0x95c/0x1018
     skcipher_encrypt+0x84/0x150
     crypto_skcipher_encrypt+0x50/0x68
     test_skcipher_vec_cfg+0x4d4/0xc10
     test_skcipher_vec+0x178/0x1d8
     alg_test_skcipher+0xec/0x230
     alg_test.par...
    55b3209a
caamalg.c 94.6 KB