Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.15.2 + bcache = kernel panic #259

Closed
shaygover opened this issue Nov 17, 2021 · 2 comments
Closed

5.15.2 + bcache = kernel panic #259

shaygover opened this issue Nov 17, 2021 · 2 comments

Comments

@shaygover
Copy link

shaygover commented Nov 17, 2021

5.14.16 works (Arch linux)
2021-11-zen.log

Nov 17 19:59:00 Main kernel: Hardware name: Gigabyte Technology Co., Ltd. X570 AORUS MASTER/X570 AORUS MASTER, BIOS F32 01/18/2021
Nov 17 19:59:00 Main kernel: Workqueue: events register_bdev_worker [bcache]
Nov 17 19:59:00 Main kernel: RIP: 0010:kmem_cache_alloc+0xe2/0x440
Nov 17 19:59:00 Main kernel: Code: 05 23 08 e9 77 48 8b 50 08 48 83 78 10 00 4c 8b 20 0f 84 ed 02 00 00 4d 85 e4 0f 84 e4 02 00 00 8b 45 28 48 8b 7d 00 4c 01 e0 <48> 8b 18 48 89 c1 48 33 9d b8 00 00 00 4c 89 e0 48 0f c9 48 31 cb
Nov 17 19:59:00 Main kernel: RSP: 0018:ffffa79b815abae0 EFLAGS: 00010282
Nov 17 19:59:00 Main kernel: RAX: 9ac6c314d61d7258 RBX: 0000000000000080 RCX: 0000000000000000
Nov 17 19:59:00 Main kernel: RDX: 000000000038c607 RSI: 0000000000000dc0 RDI: 000000000002f980
Nov 17 19:59:00 Main kernel: RBP: ffff902f40200b00 R08: 0000000000000000 R09: 0000000000000000
Nov 17 19:59:00 Main kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 9ac6c314d61d7218
Nov 17 19:59:00 Main kernel: R13: 0000000000000000 R14: 0000000000000dc0 R15: ffffffff882b078b
Nov 17 19:59:00 Main kernel: FS: 0000000000000000(0000) GS:ffff903e3ebc0000(0000) knlGS:0000000000000000
Nov 17 19:59:00 Main kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 17 19:59:00 Main kernel: CR2: 0000561514ddd0f8 CR3: 000000057fa10000 CR4: 0000000000350ee0
Nov 17 19:59:00 Main kernel: Call Trace:
Nov 17 19:59:00 Main kernel: __kernfs_new_node+0x6b/0x200
Nov 17 19:59:00 Main kernel: kernfs_new_node+0x31/0x70
Nov 17 19:59:00 Main kernel: __kernfs_create_file+0x25/0xe0
Nov 17 19:59:00 Main kernel: sysfs_create_file_ns+0xdd/0x1c0
Nov 17 19:59:00 Main kernel: device_add+0x202/0xb60
Nov 17 19:59:00 Main kernel: ? dev_set_name+0x5b/0x80
Nov 17 19:59:00 Main kernel: device_add_disk+0x9d/0x3c0
Nov 17 19:59:00 Main kernel: bch_cached_dev_run+0x109/0x280 [bcache 0e6085c24585c912b118e2f8b890979e3130ec0e]
Nov 17 19:59:00 Main kernel: bch_cached_dev_attach+0x45f/0x6a0 [bcache 0e6085c24585c912b118e2f8b890979e3130ec0e]
Nov 17 19:59:00 Main kernel: register_bdev_worker.cold+0x97/0x160 [bcache 0e6085c24585c912b118e2f8b890979e3130ec0e]
Nov 17 19:59:00 Main kernel: process_one_work+0x263/0x460
Nov 17 19:59:00 Main kernel: ? process_one_work+0x460/0x460
Nov 17 19:59:00 Main kernel: worker_thread+0x54/0x4e0
Nov 17 19:59:00 Main kernel: ? process_one_work+0x460/0x460
Nov 17 19:59:00 Main kernel: kthread+0x1b0/0x1e0
Nov 17 19:59:00 Main kernel: ? __kthread_init_worker+0x60/0x60
Nov 17 19:59:00 Main kernel: ret_from_fork+0x22/0x30
Nov 17 19:59:00 Main kernel: Modules linked in: bpf_preload ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 usbhid crc32c_intel xhci_pci xhci_pci_renesas nvidia_drm(POE) nvidia_uvm(POE) nvidia_modeset(POE) nvidia(POE) bcache crc64
Nov 17 19:59:00 Main kernel: ---[ end trace 1797f4e199b52a34 ]---
Nov 17 19:59:00 Main kernel: RIP: 0010:kmem_cache_alloc+0xe2/0x440
Nov 17 19:59:00 Main kernel: Code: 05 23 08 e9 77 48 8b 50 08 48 83 78 10 00 4c 8b 20 0f 84 ed 02 00 00 4d 85 e4 0f 84 e4 02 00 00 8b 45 28 48 8b 7d 00 4c 01 e0 <48> 8b 18 48 89 c1 48 33 9d b8 00 00 00 4c 89 e0 48 0f c9 48 31 cb
Nov 17 19:59:00 Main kernel: RSP: 0018:ffffa79b815abae0 EFLAGS: 00010282
Nov 17 19:59:00 Main kernel: RAX: 9ac6c314d61d7258 RBX: 0000000000000080 RCX: 0000000000000000
Nov 17 19:59:00 Main kernel: RDX: 000000000038c607 RSI: 0000000000000dc0 RDI: 000000000002f980
Nov 17 19:59:00 Main kernel: RBP: ffff902f40200b00 R08: 0000000000000000 R09: 0000000000000000
Nov 17 19:59:00 Main kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 9ac6c314d61d7218
Nov 17 19:59:00 Main kernel: R13: 0000000000000000 R14: 0000000000000dc0 R15: ffffffff882b078b
Nov 17 19:59:00 Main kernel: FS: 0000000000000000(0000) GS:ffff903e3ebc0000(0000) knlGS:0000000000000000
Nov 17 19:59:00 Main kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 17 19:59:00 Main kernel: CR2: 0000561514ddd0f8 CR3: 000000057fa10000 CR4: 0000000000350ee0

@heftig
Copy link

heftig commented Nov 18, 2021

Is the core linux kernel also affected?

@shaygover
Copy link
Author

yes. Closing.
Took me a while to answer as this bug caused me data corruption.

heftig pushed a commit that referenced this issue Oct 6, 2023
Add various tests to check maximum number of supported programs
being attached:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  ./test_progs -t tc_opts
  [    1.185325] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.186826] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  [    1.270123] tsc: Refined TSC clocksource calibration: 3407.988 MHz
  [    1.272428] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc932722, max_idle_ns: 440795381586 ns
  [    1.276408] clocksource: Switched to clocksource tsc
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK              <--- (new test)
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_replace:OK
  #269     tc_opts_revision:OK
  Summary: 18/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230929204121.20305-2-daniel@iogearbox.net
heftig pushed a commit that referenced this issue Oct 15, 2023
Add a new test case which performs double query of the bpf_mprog through
libbpf API, but also via raw bpf(2) syscall. This is testing to gather
first the count and then in a subsequent probe the full information with
the program array without clearing passed structs in between.

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  ./test_progs -t tc_opts
  [    1.398818] tsc: Refined TSC clocksource calibration: 3407.999 MHz
  [    1.400263] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fd336761, max_idle_ns: 440795243819 ns
  [    1.402734] clocksource: Switched to clocksource tsc
  [    1.426639] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.428112] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_query:OK            <--- (new test)
  #269     tc_opts_replace:OK
  #270     tc_opts_revision:OK
  Summary: 19/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-4-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
heftig pushed a commit that referenced this issue Oct 15, 2023
Add a new test case to query on an empty bpf_mprog and pass the revision
directly into expected_revision for attachment to assert that this does
succeed.

  ./test_progs -t tc_opts
  [    1.406778] tsc: Refined TSC clocksource calibration: 3407.990 MHz
  [    1.408863] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fcaf6eb0, max_idle_ns: 440795321766 ns
  [    1.412419] clocksource: Switched to clocksource tsc
  [    1.428671] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.430260] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  #252     tc_opts_after:OK
  #253     tc_opts_append:OK
  #254     tc_opts_basic:OK
  #255     tc_opts_before:OK
  #256     tc_opts_chain_classic:OK
  #257     tc_opts_chain_mixed:OK
  #258     tc_opts_delete_empty:OK
  #259     tc_opts_demixed:OK
  #260     tc_opts_detach:OK
  #261     tc_opts_detach_after:OK
  #262     tc_opts_detach_before:OK
  #263     tc_opts_dev_cleanup:OK
  #264     tc_opts_invalid:OK
  #265     tc_opts_max:OK
  #266     tc_opts_mixed:OK
  #267     tc_opts_prepend:OK
  #268     tc_opts_query:OK
  #269     tc_opts_query_attach:OK     <--- (new test)
  #270     tc_opts_replace:OK
  #271     tc_opts_revision:OK
  Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-6-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants