Hello, kernel test robot noticed "BUG:sleeping_function_called_from_invalid_context_at_crypto/internal.h" on: commit: 1e1d7cc33bd78b992ab90e28b02d7a2feef96538 ("[PATCH 4/6] crypto: ahash - Add virtual address support") url: https://github.com/intel-lab-lkp/linux/commits/Herbert-Xu/crypto-ahash-Only-save-callback-and-data-in-ahash_save_req/20241027-174811 base: https://git.kernel.org/cgit/linux/kernel/git/herbert/cryptodev-2.6.git master patch link: https://lore.kernel.org/all/bffef4bab1bf250bd64a3d02de53eb1fd047a96e.1730021644.git.herbert@xxxxxxxxxxxxxxxxxxx/ patch subject: [PATCH 4/6] crypto: ahash - Add virtual address support in testcase: kernel-selftests-bpf version: with following parameters: group: net/netfilter test: nft_flowtable.sh config: x86_64-rhel-8.3-bpf compiler: gcc-12 test machine: 36 threads 1 sockets Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz (Cascade Lake) with 32G memory (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <oliver.sang@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-lkp/202411050927.673246d5-lkp@xxxxxxxxx kern :err : [ 43.366785] BUG: sleeping function called from invalid context at crypto/internal.h:189 kern :err : [ 43.367576] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2600, name: socat kern :err : [ 43.368344] preempt_count: 101, expected: 0 kern :err : [ 43.368804] RCU nest depth: 1, expected: 0 kern :warn : [ 43.369258] CPU: 6 UID: 0 PID: 2600 Comm: socat Tainted: G S 6.12.0-rc1-00092-g1e1d7cc33bd7 #1 kern :warn : [ 43.370202] Tainted: [S]=CPU_OUT_OF_SPEC kern :warn : [ 43.370639] Hardware name: Gigabyte Technology Co., Ltd. X299 UD4 Pro/X299 UD4 Pro-CF, BIOS F8a 04/27/2021 kern :warn : [ 43.371552] Call Trace: kern :warn : [ 43.371871] <IRQ> kern :warn : [ 43.372155] dump_stack_lvl (lib/dump_stack.c:123) kern :warn : [ 43.372574] __might_resched (kernel/sched/core.c:8632) kern :warn : [ 43.373014] crypto_hash_walk_done (include/linux/sched.h:2031 crypto/internal.h:189 crypto/ahash.c:201) kern :warn : [ 43.373483] shash_ahash_finup (crypto/ahash.c:96) kern :warn : [ 43.373929] crypto_ahash_digest (crypto/ahash.c:747) kern :warn : [ 43.374390] crypto_authenc_genicv (crypto/authenc.c:151) authenc kern :warn : [ 43.374929] esp_output_tail (net/ipv4/esp4.c:627) esp4 kern :warn : [ 43.375417] esp_output (net/ipv4/esp4.c:701) esp4 kern :warn : [ 43.375869] xfrm_output_one (net/xfrm/xfrm_output.c:553) kern :warn : [ 43.376310] xfrm_output_resume (net/xfrm/xfrm_output.c:588) kern :warn : [ 43.376763] ? __pfx_csum_partial_ext (include/net/checksum.h:120) kern :warn : [ 43.377252] ? __pfx_csum_block_add_ext (net/core/skbuff.c:103) kern :warn : [ 43.377754] ? skb_checksum_help (net/core/dev.c:3346) kern :warn : [ 43.378215] __netif_receive_skb_one_core (net/core/dev.c:5662 (discriminator 4)) kern :warn : [ 43.378732] process_backlog (include/linux/rcupdate.h:882 net/core/dev.c:6108) kern :warn : [ 43.379163] __napi_poll+0x28/0x1c0 kern :warn : [ 43.379652] net_rx_action (net/core/dev.c:6842 net/core/dev.c:6962) kern :warn : [ 43.380078] handle_softirqs (kernel/softirq.c:554) kern :warn : [ 43.380518] do_softirq (kernel/softirq.c:455 kernel/softirq.c:442) kern :warn : [ 43.380907] </IRQ> kern :warn : [ 43.381196] <TASK> kern :warn : [ 43.381485] __local_bh_enable_ip (kernel/softirq.c:382) kern :warn : [ 43.381945] tcp_sendmsg (net/ipv4/tcp.c:1361) kern :warn : [ 43.382342] sock_write_iter (net/socket.c:729 net/socket.c:744 net/socket.c:1165) kern :warn : [ 43.382781] ? sock_recvmsg (net/socket.c:1051 net/socket.c:1073) kern :warn : [ 43.383199] vfs_write (fs/read_write.c:590 fs/read_write.c:683) kern :warn : [ 43.383598] ksys_write (include/linux/file.h:83 fs/read_write.c:739) kern :warn : [ 43.383987] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) kern :warn : [ 43.384406] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) kern :warn : [ 43.384937] RIP: 0033:0x7f39ddcef240 kern :warn : [ 43.385348] Code: 40 00 48 8b 15 c1 9b 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d a1 23 0e 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89 All code ======== 0: 40 00 48 8b rex add %cl,-0x75(%rax) 4: 15 c1 9b 0d 00 adc $0xd9bc1,%eax 9: f7 d8 neg %eax b: 64 89 02 mov %eax,%fs:(%rdx) e: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax 15: eb b7 jmp 0xffffffffffffffce 17: 0f 1f 00 nopl (%rax) 1a: 80 3d a1 23 0e 00 00 cmpb $0x0,0xe23a1(%rip) # 0xe23c2 21: 74 17 je 0x3a 23: b8 01 00 00 00 mov $0x1,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 58 ja 0x8a 32: c3 ret 33: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 3a: 48 83 ec 28 sub $0x28,%rsp 3e: 48 rex.W 3f: 89 .byte 0x89 Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 58 ja 0x60 8: c3 ret 9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 10: 48 83 ec 28 sub $0x28,%rsp 14: 48 rex.W 15: 89 .byte 0x89 kern :warn : [ 43.387012] RSP: 002b:00007fff1b6b3288 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 kern :warn : [ 43.387756] RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 00007f39ddcef240 kern :warn : [ 43.388465] RDX: 0000000000002000 RSI: 000055ba398a7000 RDI: 0000000000000007 kern :warn : [ 43.389173] RBP: 000055ba398a7000 R08: 0000000000002000 R09: 0000000000000000 kern :warn : [ 43.389881] R10: 00007f39ddc104f0 R11: 0000000000000202 R12: 0000000000002000 kern :warn : [ 43.390590] R13: 0000000000000007 R14: 0000000000002000 R15: 000055ba398a7000 kern :warn : [ 43.391300] </TASK> The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20241105/202411050927.673246d5-lkp@xxxxxxxxx -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki