tempesta icon indicating copy to clipboard operation
tempesta copied to clipboard

Kernel bug at crypto/cryptd.c, invalid opcode

Open symstu-tempesta opened this issue 7 months ago • 1 comments

I’ve been switching between different patched kernels over the past six months, so it’s possible that some conflicts have built up over time.

The error appears periodically — every few seconds — and it seems like some service is trying to start. This error occurs when Tempesta is shut down.

If I start Tempesta for testing purposes, the OS crashes, even though some tests may finish successfully beforehand.

dmesg log

[44993.486399] ---[ end trace 89265506c77e0709 ]---
[44993.486401] RIP: 0010:cryptd_find_alg_cached+0x164/0x170 [cryptd]
[44993.486403] Code: 07 00 0f 1f 40 00 48 83 c4 20 48 89 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 60 ff ff ff 48 8b 7d c8 c6 07 00 0f 1f 40 00 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 f9 48
[44993.486404] RSP: 0018:ffffb905c099bc60 EFLAGS: 00010202
[44993.486405] RAX: 0000000000000008 RBX: ffff9dc922f32848 RCX: 000000008010000e
[44993.486406] RDX: 0000000000000001 RSI: 000000008010000e RDI: ffffffffc089be44
[44993.486407] RBP: ffffb905c099bca8 R08: 0000000000000001 R09: ffffffffb4906d00
[44993.486408] R10: ffff9dc929429200 R11: 0000000000000001 R12: ffffb905c099bcb8
[44993.486409] R13: 0000000000002000 R14: ffffffffc089c2d8 R15: 0000000000000008
[44993.486410] FS:  00007f8d52b227c0(0000) GS:ffff9dca76d00000(0000) knlGS:0000000000000000
[44993.486411] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[44993.486412] CR2: 00007f8d522e5025 CR3: 000000019c36c002 CR4: 00000000003706e0
[44998.495994] ------------[ cut here ]------------
[44998.495999] kernel BUG at crypto/cryptd.c:957!
[44998.496004] invalid opcode: 0000 [#8981] SMP PTI
[44998.496006] CPU: 2 PID: 25428 Comm: charon Tainted: G      D    OE     5.10.35.tfw-4c9ba16 #1
[44998.496007] Hardware name: Timi TM1613/TM1613, BIOS A06 10/28/2016
[44998.496011] RIP: 0010:cryptd_find_alg_cached+0x164/0x170 [cryptd]
[44998.496013] Code: 07 00 0f 1f 40 00 48 83 c4 20 48 89 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 60 ff ff ff 48 8b 7d c8 c6 07 00 0f 1f 40 00 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 f9 48
[44998.496014] RSP: 0018:ffffb905c212bc60 EFLAGS: 00010202
[44998.496016] RAX: 0000000000000008 RBX: ffff9dc922f32848 RCX: 0000000000000000
[44998.496017] RDX: 0000000000000001 RSI: ffffffffc089b100 RDI: ffffffffc089be44
[44998.496018] RBP: ffffb905c212bca8 R08: ffff9dc922f32848 R09: 0000000000000011
[44998.496019] R10: ffffb905c212bd38 R11: ffffb906c212bcbe R12: ffffb905c212bcb8
[44998.496020] R13: 0000000000002000 R14: ffffffffc089c2d8 R15: 0000000000000008
[44998.496022] FS:  00007fc4639797c0(0000) GS:ffff9dca76d00000(0000) knlGS:0000000000000000
[44998.496023] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[44998.496024] CR2: 00007fc46313c025 CR3: 000000019c36e006 CR4: 00000000003706e0
[44998.496025] Call Trace:
[44998.496029]  ? crypto_alloc_skcipher+0x30/0x30
[44998.496032]  cryptd_alloc_skcipher+0x90/0xe0 [cryptd]
[44998.496034]  ? crypto_mod_get+0x19/0x60
[44998.496035]  ? __crypto_alg_lookup+0x8f/0x140
[44998.496038]  simd_skcipher_init+0x26/0x60 [crypto_simd]
[44998.496040]  crypto_skcipher_init_tfm+0x3a/0x40
[44998.496042]  crypto_create_tfm_node+0x5f/0x110
[44998.496043]  crypto_alloc_tfm_node+0x5d/0x120
[44998.496045]  crypto_alloc_skcipher+0x1f/0x30
[44998.496047]  skcipher_bind+0xe/0x10 [algif_skcipher]
[44998.496049]  alg_bind+0x89/0x150 [af_alg]
[44998.496051]  __sys_bind+0xef/0x110
[44998.496054]  ? exit_to_user_mode_prepare+0x3d/0x170
[44998.496056]  __x64_sys_bind+0x1a/0x20
[44998.496058]  do_syscall_64+0x38/0x90
[44998.496060]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[44998.496061] RIP: 0033:0x7fc463ede4bb

lsmod output

root@pc:/home/symstu# lsmod
Module                  Size  Used by
rfcomm                 81920  4
xt_conntrack           16384  1
nft_chain_nat          16384  3
xt_MASQUERADE          20480  1
nf_conntrack_netlink    49152  0
xfrm_user              36864  1
xfrm_algo              16384  1 xfrm_user
nft_counter            16384  15
xt_addrtype            16384  2
nft_compat             20480  4
nf_tables             200704  43 nft_compat,nft_counter,nft_chain_nat
nfnetlink              16384  4 nft_compat,nf_conntrack_netlink,nf_tables
br_netfilter           28672  0
bridge                217088  1 br_netfilter
stp                    16384  1 bridge
llc                    16384  2 bridge,stp
twofish_generic        20480  0
twofish_avx_x86_64     53248  11204
twofish_x86_64_3way    28672  1 twofish_avx_x86_64
twofish_x86_64         16384  2 twofish_x86_64_3way,twofish_avx_x86_64
twofish_common         24576  4 twofish_x86_64,twofish_generic,twofish_x86_64_3way,twofish_avx_x86_64
serpent_avx2           49152  0
serpent_avx_x86_64     49152  1 serpent_avx2
serpent_sse2_x86_64    53248  0
serpent_generic        28672  3 serpent_avx2,serpent_sse2_x86_64,serpent_avx_x86_64
blowfish_generic       16384  0
blowfish_x86_64        24576  0
blowfish_common        20480  2 blowfish_generic,blowfish_x86_64
cast5_avx_x86_64       53248  0
cast5_generic          24576  1 cast5_avx_x86_64
cast_common            16384  2 cast5_generic,cast5_avx_x86_64
des_generic            16384  0
libdes                 24576  1 des_generic
camellia_generic       32768  0
camellia_aesni_avx2    28672  0
camellia_aesni_avx_x86_64    28672  1 camellia_aesni_avx2
camellia_x86_64        53248  2 camellia_aesni_avx_x86_64,camellia_aesni_avx2
xcbc                   16384  0
md4                    16384  0
vboxnetadp             28672  0
vboxnetflt             28672  0
vboxdrv               520192  2 vboxnetadp,vboxnetflt
cmac                   16384  2
algif_hash             16384  1
algif_skcipher         16384  11205
af_alg                 28672  6 algif_hash,algif_skcipher
snd_hda_codec_hdmi     61440  1
snd_hda_codec_realtek   131072  1
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
ledtrig_audio          16384  1 snd_hda_codec_generic
overlay               118784  0
bnep                   24576  2
binfmt_misc            24576  1
snd_hda_intel          53248  3
snd_intel_dspcfg       28672  1 snd_hda_intel
snd_hda_codec         147456  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           94208  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               114688  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
intel_rapl_msr         20480  0
intel_rapl_common      24576  1 intel_rapl_msr
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
x86_pkg_temp_thermal    20480  0
intel_powerclamp       20480  0
coretemp               20480  0
kvm_intel             294912  0
snd_rawmidi            36864  1 snd_seq_midi
mei_hdcp               24576  0
kvm                   782336  1 kvm_intel
iwlmvm                405504  0
uvcvideo               98304  0
btusb                  57344  0
videobuf2_vmalloc      20480  1 uvcvideo
btrtl                  20480  1 btusb
mac80211              962560  1 iwlmvm
btbcm                  16384  1 btusb
crct10dif_pclmul       16384  1
btintel                28672  1 btusb
videobuf2_memops       20480  1 videobuf2_vmalloc
ghash_clmulni_intel    16384  0
i915                 2244608  11
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
videobuf2_v4l2         32768  1 uvcvideo
libarc4                16384  1 mac80211
bluetooth             589824  33 btrtl,btintel,btbcm,bnep,btusb,rfcomm
videobuf2_common       61440  2 videobuf2_v4l2,uvcvideo
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
aesni_intel           372736  7
nls_iso8859_1          16384  1
iwlwifi               364544  1 iwlmvm
videodev              249856  3 videobuf2_v4l2,uvcvideo,videobuf2_common
ecdh_generic           16384  1 bluetooth
snd_timer              40960  2 snd_seq,snd_pcm
crypto_simd            16384  8 camellia_aesni_avx_x86_64,camellia_aesni_avx2,serpent_avx2,serpent_sse2_x86_64,aesni_intel,serpent_avx_x86_64,cast5_avx_x86_64,twofish_avx_x86_64
drm_kms_helper        233472  1 i915
ecc                    32768  1 ecdh_generic
mc                     57344  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
cryptd                 28672  11215 crypto_simd,ghash_clmulni_intel
glue_helper            16384  9 camellia_aesni_avx_x86_64,camellia_x86_64,camellia_aesni_avx2,twofish_x86_64_3way,serpent_avx2,serpent_sse2_x86_64,aesni_intel,serpent_avx_x86_64,twofish_avx_x86_64
rapl                   20480  0
cec                    53248  2 drm_kms_helper,i915
joydev                 24576  0
input_leds             16384  0
intel_cstate           20480  0
i2c_algo_bit           16384  1 i915
dell_wmi_aio           16384  0
serio_raw              20480  0
snd                    94208  17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi
intel_wmi_thunderbolt    20480  0
mei_me                 40960  1
sparse_keymap          16384  1 dell_wmi_aio
cfg80211              843776  3 iwlmvm,iwlwifi,mac80211
fb_sys_fops            16384  1 drm_kms_helper
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
wmi_bmof               16384  0
soundcore              16384  1 snd
sysimgblt              16384  1 drm_kms_helper
mei                   118784  3 mei_hdcp,mei_me
intel_xhci_usb_role_switch    16384  0
hp_wireless            16384  0
mac_hid                16384  0
acpi_pad              184320  0
sch_fq_codel           20480  1
nf_nat_pptp            20480  0
nf_conntrack_pptp      24576  1 nf_nat_pptp
nf_nat                 45056  3 nf_nat_pptp,nft_chain_nat,xt_MASQUERADE
nf_conntrack          151552  6 xt_conntrack,nf_nat,nf_conntrack_pptp,nf_nat_pptp,nf_conntrack_netlink,xt_MASQUERADE
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
msr                    16384  0
parport_pc             45056  0
nfsd                  491520  13
ppdev                  24576  0
drm                   548864  7 drm_kms_helper,i915
auth_rpcgss           135168  1 nfsd
lp                     20480  0
nfs_acl                16384  1 nfsd
lockd                 102400  1 nfsd
parport                65536  3 parport_pc,lp,ppdev
grace                  16384  2 nfsd,lockd
efi_pstore             16384  0
sunrpc                569344  17 nfsd,auth_rpcgss,lockd,nfs_acl
ip_tables              32768  0
x_tables               49152  5 xt_conntrack,nft_compat,xt_addrtype,ip_tables,xt_MASQUERADE
autofs4                45056  2
btrfs                1323008  0
blake2b_generic        20480  0
zstd_compress         176128  1 btrfs
raid10                 57344  0
raid456               155648  0
async_raid6_recov      24576  1 raid456
async_memcpy           20480  2 raid456,async_raid6_recov
async_pq               24576  2 raid456,async_raid6_recov
async_xor              20480  3 async_pq,raid456,async_raid6_recov
async_tx               20480  5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov
xor                    24576  2 async_xor,btrfs
raid6_pq              114688  4 async_pq,btrfs,raid456,async_raid6_recov
libcrc32c              16384  5 nf_conntrack,nf_nat,btrfs,nf_tables,raid456
raid1                  49152  0
raid0                  24576  0
multipath              20480  0
linear                 20480  0
nvme                   45056  4
ahci                   40960  0
i2c_i801               32768  0
psmouse               155648  0
nvme_core             122880  6 nvme
i2c_smbus              20480  1 i2c_i801
libahci                36864  1 ahci
crc32_pclmul           16384  0
wmi                    32768  3 intel_wmi_thunderbolt,dell_wmi_aio,wmi_bmof
video                  49152  1 i915
pinctrl_sunrisepoint    28672  0

Expected Behavior No errors in dmesg output

Configuration file All kernels I have used from tempesta-ci, last one was - 5.10.35.tfw-4c9ba16. First one i tried from master - https://github.com/tempesta-tech/tempesta/commit/b150f736fd4372dfbb0b03b2b777cef4fed41f6e

symstu-tempesta avatar May 06 '25 15:05 symstu-tempesta

After a full OS reinstall, the error disappeared — so it’s clearly not a hardware issue, but rather something related to the previous system state or configuration

symstu-tempesta avatar May 06 '25 16:05 symstu-tempesta