# git rev-parse -q --verify 21d4120ec6f5b5992b01b96ac484701163917b63^{commit} 21d4120ec6f5b5992b01b96ac484701163917b63 already have revision, skipping fetch # git checkout -q -f -B kisskb 21d4120ec6f5b5992b01b96ac484701163917b63 # git clean -qxdf # < git log -1 # commit 21d4120ec6f5b5992b01b96ac484701163917b63 # Author: Eric Biggers # Date: Tue Jul 2 14:17:00 2019 -0700 # # crypto: user - prevent operating on larval algorithms # # Michal Suchanek reported [1] that running the pcrypt_aead01 test from # LTP [2] in a loop and holding Ctrl-C causes a NULL dereference of # alg->cra_users.next in crypto_remove_spawns(), via crypto_del_alg(). # The test repeatedly uses CRYPTO_MSG_NEWALG and CRYPTO_MSG_DELALG. # # The crash occurs when the instance that CRYPTO_MSG_DELALG is trying to # unregister isn't a real registered algorithm, but rather is a "test # larval", which is a special "algorithm" added to the algorithms list # while the real algorithm is still being tested. Larvals don't have # initialized cra_users, so that causes the crash. Normally pcrypt_aead01 # doesn't trigger this because CRYPTO_MSG_NEWALG waits for the algorithm # to be tested; however, CRYPTO_MSG_NEWALG returns early when interrupted. # # Everything else in the "crypto user configuration" API has this same bug # too, i.e. it inappropriately allows operating on larval algorithms # (though it doesn't look like the other cases can cause a crash). # # Fix this by making crypto_alg_match() exclude larval algorithms. # # [1] https://lkml.kernel.org/r/20190625071624.27039-1-msuchanek@suse.de # [2] https://github.com/linux-test-project/ltp/blob/20190517/testcases/kernel/crypto/pcrypt_aead01.c # # Reported-by: Michal Suchanek # Fixes: a38f7907b926 ("crypto: Add userspace configuration API") # Cc: # v3.2+ # Cc: Steffen Klassert # Signed-off-by: Eric Biggers # Signed-off-by: Herbert Xu # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 21d4120ec6f5b5992b01b96ac484701163917b63 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/crypto_powernv_defconfig+NO_PERF_ppc64le-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- powernv_defconfig # Added to kconfig CONFIG_PERF_EVENTS=n # yes \n | make -s -j 80 ARCH=powerpc O=/kisskb/build/crypto_powernv_defconfig+NO_PERF_ppc64le-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- oldconfig yes: standard output: Broken pipe # make -s -j 80 ARCH=powerpc O=/kisskb/build/crypto_powernv_defconfig+NO_PERF_ppc64le-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- :1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp] :1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp] :1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp] :1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp] /kisskb/src/net/sunrpc/xprtsock.c: In function 'xs_stream_data_receive': /kisskb/src/net/sunrpc/xprtsock.c:529:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? ret : read; ^ /kisskb/src/net/sunrpc/xprtsock.c:499:10: note: 'ret' was declared here ssize_t ret; ^ /kisskb/src/net/sunrpc/xprtsock.c:498:15: warning: 'read' may be used uninitialized in this function [-Wmaybe-uninitialized] size_t want, read; ^ WARNING: vmlinux.o(.text+0x2d28): Section mismatch in reference from the variable start_here_multiplatform to the function .init.text:early_setup() The function start_here_multiplatform() references the function __init early_setup(). This is often because start_here_multiplatform lacks a __init annotation or the annotation of early_setup is wrong. WARNING: vmlinux.o(.text+0x2d5c): Section mismatch in reference from the variable start_here_common to the function .init.text:start_kernel() The function start_here_common() references the function __init start_kernel(). This is often because start_here_common lacks a __init annotation or the annotation of start_kernel is wrong. Completed OK # rm -rf /kisskb/build/crypto_powernv_defconfig+NO_PERF_ppc64le-gcc5 # Build took: 0:02:48.730722