• E
    crypto: testmgr - skip crc32c context test for ahash algorithms · 99f8efac
    Eric Biggers 提交于
    mainline inclusion
    from mainline-eb5e6730 master
    commit eb5e6730
    category: bugfix
    bugzilla: 11390
    CVE: NA
    
    ---------------------------
    
    Instantiating "cryptd(crc32c)" causes a crypto self-test failure because
    the crypto_alloc_shash() in alg_test_crc32c() fails.  This is because
    cryptd(crc32c) is an ahash algorithm, not a shash algorithm; so it can
    only be accessed through the ahash API, unlike shash algorithms which
    can be accessed through both the ahash and shash APIs.
    
    As the test is testing the shash descriptor format which is only
    applicable to shash algorithms, skip it for ahash algorithms.
    
    (Note that it's still important to fix crypto self-test failures even
     for weird algorithm instantiations like cryptd(crc32c) that no one
     would really use; in fips_enabled mode unprivileged users can use them
     to panic the kernel, and also they prevent treating a crypto self-test
     failure as a bug when fuzzing the kernel.)
    
    Fixes: 8e3ee85e ("crypto: crc32c - Test descriptor context format")
    Cc: stable@vger.kernel.org
    Signed-off-by: NEric Biggers <ebiggers@google.com>
    Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: NJason Yan <yanaijie@huawei.com>
    Reviewed-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    99f8efac
testmgr.c 84.7 KB