[Kernel-packages] [Bug 2045778] Re: panic due to unhandled page fault via BPF_PROG_RUN syscall

2023-12-08 Thread Lorenz Bauer
Trying to upload dmesg crashes the site.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-azure in Ubuntu.
https://bugs.launchpad.net/bugs/2045778

Title:
  panic due to unhandled page fault via BPF_PROG_RUN syscall

Status in linux-azure package in Ubuntu:
  Triaged

Bug description:
  Here is a kernel oops triggered from user space by invoking a BPF
  program:

  [ 1191.051531] BUG: unable to handle page fault for address: ea053c70
  [ 1191.053848] #PF: supervisor read access in kernel mode
  [ 1191.055183] #PF: error_code(0x) - not-present page
  [ 1191.056513] PGD 334e15067 P4D 334e15067 PUD 334e17067 PMD 0 
  [ 1191.058016] Oops:  [#1] SMP NOPTI
  [ 1191.058984] CPU: 1 PID: 2557 Comm: ebpf.test Not tainted 6.2.0-1016-azure 
#16~22.04.1-Ubuntu
  [ 1191.061167] Hardware name: Microsoft Corporation Virtual Machine/Virtual 
Machine, BIOS 090008  12/07/2018
  [ 1191.063804] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.065064] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
  [ 1191.069766] RSP: 0018:a64e03053c50 EFLAGS: 00010246
  [ 1191.071117] RAX: 0001 RBX: a64e0005a000 RCX: 
a64e03053c3f
  [ 1191.073415] RDX: 0001 RSI: a64e03053c3f RDI: 
8a468580
  [ 1191.075351] RBP: ea053cf0 R08:  R09: 

  [ 1191.077722] R10:  R11:  R12: 
97dc75673c00
  [ 1191.079681] R13: a64e0005a048 R14: a64e03053d34 R15: 
0001
  [ 1191.081636] FS:  7fd4a2ffd640() GS:97df6fc8() 
knlGS:
  [ 1191.083866] CS:  0010 DS:  ES:  CR0: 80050033
  [ 1191.085455] CR2: ea053c70 CR3: 00019ff80001 CR4: 
00370ee0
  [ 1191.087405] Call Trace:
  [ 1191.088121]  
  [ 1191.088745]  ? show_regs+0x6a/0x80
  [ 1191.089710]  ? __die+0x25/0x70
  [ 1191.090591]  ? page_fault_oops+0x79/0x180
  [ 1191.091708]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.093027]  ? search_exception_tables+0x61/0x70
  [ 1191.094421]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.095686]  ? kernelmode_fixup_or_oops+0xa2/0x120
  [ 1191.097014]  ? __bad_area_nosemaphore+0x16f/0x280
  [ 1191.098323]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.099584]  ? apparmor_file_alloc_security+0x1f/0xd0
  [ 1191.100989]  ? bad_area_nosemaphore+0x16/0x20
  [ 1191.102235]  ? do_kern_addr_fault+0x62/0x80
  [ 1191.103393]  ? exc_page_fault+0xd8/0x160
  [ 1191.104505]  ? asm_exc_page_fault+0x27/0x30
  [ 1191.105669]  ? bpf_test_run+0x104/0x2e0
  [ 1191.106745]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.108010]  ? bpf_prog_test_run_skb+0x2e4/0x4f0
  [ 1191.109350]  ? __fdget+0x13/0x20
  [ 1191.110304]  ? __sys_bpf+0x706/0xea0
  [ 1191.111299]  ? __x64_sys_bpf+0x1a/0x30
  [ 1191.112307]  ? do_syscall_64+0x5c/0x90
  [ 1191.113366]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.114634]  ? exit_to_user_mode_loop+0xec/0x160
  [ 1191.115929]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.117466]  ? __set_task_blocked+0x29/0x70
  [ 1191.118904]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.120482]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.122073]  ? sigprocmask+0xb8/0xe0
  [ 1191.123360]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.124868]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.126523]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.128028]  ? syscall_exit_to_user_mode+0x27/0x40
  [ 1191.129599]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.131033]  ? do_syscall_64+0x69/0x90
  [ 1191.132242]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.134199]  ? do_syscall_64+0x69/0x90
  [ 1191.135504]  ? entry_SYSCALL_64_after_hwframe+0x73/0xdd
  [ 1191.137137]  
  [ 1191.137942] Modules linked in: nft_chain_nat xt_MASQUERADE nf_nat 
nf_conntrack_netlink xfrm_user xfrm_algo xt_addrtype br_netfilter bridge stp 
llc xt_tcpudp tls xt_owner xt_conntrack nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink overlay nvme_fabrics 
udf crc_itu_t binfmt_misc nls_iso8859_1 kvm_amd ccp joydev kvm hid_generic 
irqbypass crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha512_ssse3 aesni_intel crypto_simd cryptd hyperv_drm 
drm_kms_helper syscopyarea sysfillrect serio_raw sysimgblt drm_shmem_helper 
hid_hyperv hv_netvsc hid hyperv_keyboard pata_acpi dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore i2c_core ip_tables 
x_tables autofs4
  [ 1191.156484] CR2: ea053c70
  [ 1191.158026] ---[ end trace  ]---
  [ 1191.159518] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.160912] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 

[Kernel-packages] [Bug 2045778] Re: panic due to unhandled page fault via BPF_PROG_RUN syscall

2023-12-08 Thread Lorenz Bauer
** Attachment added: "lspci-vvnn.log"
   
https://bugs.launchpad.net/ubuntu/+source/linux-azure/+bug/2045778/+attachment/5727445/+files/lspci-vvnn.log

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-azure in Ubuntu.
https://bugs.launchpad.net/bugs/2045778

Title:
  panic due to unhandled page fault via BPF_PROG_RUN syscall

Status in linux-azure package in Ubuntu:
  Triaged

Bug description:
  Here is a kernel oops triggered from user space by invoking a BPF
  program:

  [ 1191.051531] BUG: unable to handle page fault for address: ea053c70
  [ 1191.053848] #PF: supervisor read access in kernel mode
  [ 1191.055183] #PF: error_code(0x) - not-present page
  [ 1191.056513] PGD 334e15067 P4D 334e15067 PUD 334e17067 PMD 0 
  [ 1191.058016] Oops:  [#1] SMP NOPTI
  [ 1191.058984] CPU: 1 PID: 2557 Comm: ebpf.test Not tainted 6.2.0-1016-azure 
#16~22.04.1-Ubuntu
  [ 1191.061167] Hardware name: Microsoft Corporation Virtual Machine/Virtual 
Machine, BIOS 090008  12/07/2018
  [ 1191.063804] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.065064] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
  [ 1191.069766] RSP: 0018:a64e03053c50 EFLAGS: 00010246
  [ 1191.071117] RAX: 0001 RBX: a64e0005a000 RCX: 
a64e03053c3f
  [ 1191.073415] RDX: 0001 RSI: a64e03053c3f RDI: 
8a468580
  [ 1191.075351] RBP: ea053cf0 R08:  R09: 

  [ 1191.077722] R10:  R11:  R12: 
97dc75673c00
  [ 1191.079681] R13: a64e0005a048 R14: a64e03053d34 R15: 
0001
  [ 1191.081636] FS:  7fd4a2ffd640() GS:97df6fc8() 
knlGS:
  [ 1191.083866] CS:  0010 DS:  ES:  CR0: 80050033
  [ 1191.085455] CR2: ea053c70 CR3: 00019ff80001 CR4: 
00370ee0
  [ 1191.087405] Call Trace:
  [ 1191.088121]  
  [ 1191.088745]  ? show_regs+0x6a/0x80
  [ 1191.089710]  ? __die+0x25/0x70
  [ 1191.090591]  ? page_fault_oops+0x79/0x180
  [ 1191.091708]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.093027]  ? search_exception_tables+0x61/0x70
  [ 1191.094421]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.095686]  ? kernelmode_fixup_or_oops+0xa2/0x120
  [ 1191.097014]  ? __bad_area_nosemaphore+0x16f/0x280
  [ 1191.098323]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.099584]  ? apparmor_file_alloc_security+0x1f/0xd0
  [ 1191.100989]  ? bad_area_nosemaphore+0x16/0x20
  [ 1191.102235]  ? do_kern_addr_fault+0x62/0x80
  [ 1191.103393]  ? exc_page_fault+0xd8/0x160
  [ 1191.104505]  ? asm_exc_page_fault+0x27/0x30
  [ 1191.105669]  ? bpf_test_run+0x104/0x2e0
  [ 1191.106745]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.108010]  ? bpf_prog_test_run_skb+0x2e4/0x4f0
  [ 1191.109350]  ? __fdget+0x13/0x20
  [ 1191.110304]  ? __sys_bpf+0x706/0xea0
  [ 1191.111299]  ? __x64_sys_bpf+0x1a/0x30
  [ 1191.112307]  ? do_syscall_64+0x5c/0x90
  [ 1191.113366]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.114634]  ? exit_to_user_mode_loop+0xec/0x160
  [ 1191.115929]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.117466]  ? __set_task_blocked+0x29/0x70
  [ 1191.118904]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.120482]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.122073]  ? sigprocmask+0xb8/0xe0
  [ 1191.123360]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.124868]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.126523]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.128028]  ? syscall_exit_to_user_mode+0x27/0x40
  [ 1191.129599]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.131033]  ? do_syscall_64+0x69/0x90
  [ 1191.132242]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.134199]  ? do_syscall_64+0x69/0x90
  [ 1191.135504]  ? entry_SYSCALL_64_after_hwframe+0x73/0xdd
  [ 1191.137137]  
  [ 1191.137942] Modules linked in: nft_chain_nat xt_MASQUERADE nf_nat 
nf_conntrack_netlink xfrm_user xfrm_algo xt_addrtype br_netfilter bridge stp 
llc xt_tcpudp tls xt_owner xt_conntrack nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink overlay nvme_fabrics 
udf crc_itu_t binfmt_misc nls_iso8859_1 kvm_amd ccp joydev kvm hid_generic 
irqbypass crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha512_ssse3 aesni_intel crypto_simd cryptd hyperv_drm 
drm_kms_helper syscopyarea sysfillrect serio_raw sysimgblt drm_shmem_helper 
hid_hyperv hv_netvsc hid hyperv_keyboard pata_acpi dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore i2c_core ip_tables 
x_tables autofs4
  [ 1191.156484] CR2: ea053c70
  [ 1191.158026] ---[ end trace  ]---
  [ 1191.159518] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.160912] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 

[Kernel-packages] [Bug 2045778] Re: panic due to unhandled page fault via BPF_PROG_RUN syscall

2023-12-08 Thread Lorenz Bauer
** Attachment added: "uname-a.log"
   
https://bugs.launchpad.net/ubuntu/+source/linux-azure/+bug/2045778/+attachment/5727444/+files/uname-a.log

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-azure in Ubuntu.
https://bugs.launchpad.net/bugs/2045778

Title:
  panic due to unhandled page fault via BPF_PROG_RUN syscall

Status in linux-azure package in Ubuntu:
  Triaged

Bug description:
  Here is a kernel oops triggered from user space by invoking a BPF
  program:

  [ 1191.051531] BUG: unable to handle page fault for address: ea053c70
  [ 1191.053848] #PF: supervisor read access in kernel mode
  [ 1191.055183] #PF: error_code(0x) - not-present page
  [ 1191.056513] PGD 334e15067 P4D 334e15067 PUD 334e17067 PMD 0 
  [ 1191.058016] Oops:  [#1] SMP NOPTI
  [ 1191.058984] CPU: 1 PID: 2557 Comm: ebpf.test Not tainted 6.2.0-1016-azure 
#16~22.04.1-Ubuntu
  [ 1191.061167] Hardware name: Microsoft Corporation Virtual Machine/Virtual 
Machine, BIOS 090008  12/07/2018
  [ 1191.063804] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.065064] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
  [ 1191.069766] RSP: 0018:a64e03053c50 EFLAGS: 00010246
  [ 1191.071117] RAX: 0001 RBX: a64e0005a000 RCX: 
a64e03053c3f
  [ 1191.073415] RDX: 0001 RSI: a64e03053c3f RDI: 
8a468580
  [ 1191.075351] RBP: ea053cf0 R08:  R09: 

  [ 1191.077722] R10:  R11:  R12: 
97dc75673c00
  [ 1191.079681] R13: a64e0005a048 R14: a64e03053d34 R15: 
0001
  [ 1191.081636] FS:  7fd4a2ffd640() GS:97df6fc8() 
knlGS:
  [ 1191.083866] CS:  0010 DS:  ES:  CR0: 80050033
  [ 1191.085455] CR2: ea053c70 CR3: 00019ff80001 CR4: 
00370ee0
  [ 1191.087405] Call Trace:
  [ 1191.088121]  
  [ 1191.088745]  ? show_regs+0x6a/0x80
  [ 1191.089710]  ? __die+0x25/0x70
  [ 1191.090591]  ? page_fault_oops+0x79/0x180
  [ 1191.091708]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.093027]  ? search_exception_tables+0x61/0x70
  [ 1191.094421]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.095686]  ? kernelmode_fixup_or_oops+0xa2/0x120
  [ 1191.097014]  ? __bad_area_nosemaphore+0x16f/0x280
  [ 1191.098323]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.099584]  ? apparmor_file_alloc_security+0x1f/0xd0
  [ 1191.100989]  ? bad_area_nosemaphore+0x16/0x20
  [ 1191.102235]  ? do_kern_addr_fault+0x62/0x80
  [ 1191.103393]  ? exc_page_fault+0xd8/0x160
  [ 1191.104505]  ? asm_exc_page_fault+0x27/0x30
  [ 1191.105669]  ? bpf_test_run+0x104/0x2e0
  [ 1191.106745]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.108010]  ? bpf_prog_test_run_skb+0x2e4/0x4f0
  [ 1191.109350]  ? __fdget+0x13/0x20
  [ 1191.110304]  ? __sys_bpf+0x706/0xea0
  [ 1191.111299]  ? __x64_sys_bpf+0x1a/0x30
  [ 1191.112307]  ? do_syscall_64+0x5c/0x90
  [ 1191.113366]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.114634]  ? exit_to_user_mode_loop+0xec/0x160
  [ 1191.115929]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.117466]  ? __set_task_blocked+0x29/0x70
  [ 1191.118904]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.120482]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.122073]  ? sigprocmask+0xb8/0xe0
  [ 1191.123360]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.124868]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.126523]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.128028]  ? syscall_exit_to_user_mode+0x27/0x40
  [ 1191.129599]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.131033]  ? do_syscall_64+0x69/0x90
  [ 1191.132242]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.134199]  ? do_syscall_64+0x69/0x90
  [ 1191.135504]  ? entry_SYSCALL_64_after_hwframe+0x73/0xdd
  [ 1191.137137]  
  [ 1191.137942] Modules linked in: nft_chain_nat xt_MASQUERADE nf_nat 
nf_conntrack_netlink xfrm_user xfrm_algo xt_addrtype br_netfilter bridge stp 
llc xt_tcpudp tls xt_owner xt_conntrack nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink overlay nvme_fabrics 
udf crc_itu_t binfmt_misc nls_iso8859_1 kvm_amd ccp joydev kvm hid_generic 
irqbypass crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha512_ssse3 aesni_intel crypto_simd cryptd hyperv_drm 
drm_kms_helper syscopyarea sysfillrect serio_raw sysimgblt drm_shmem_helper 
hid_hyperv hv_netvsc hid hyperv_keyboard pata_acpi dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore i2c_core ip_tables 
x_tables autofs4
  [ 1191.156484] CR2: ea053c70
  [ 1191.158026] ---[ end trace  ]---
  [ 1191.159518] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.160912] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 

[Kernel-packages] [Bug 2045778] Re: panic due to unhandled page fault via BPF_PROG_RUN syscall

2023-12-08 Thread Lorenz Bauer
** Attachment added: "version.log"
   
https://bugs.launchpad.net/ubuntu/+source/linux-azure/+bug/2045778/+attachment/5727443/+files/version.log

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-azure in Ubuntu.
https://bugs.launchpad.net/bugs/2045778

Title:
  panic due to unhandled page fault via BPF_PROG_RUN syscall

Status in linux-azure package in Ubuntu:
  Triaged

Bug description:
  Here is a kernel oops triggered from user space by invoking a BPF
  program:

  [ 1191.051531] BUG: unable to handle page fault for address: ea053c70
  [ 1191.053848] #PF: supervisor read access in kernel mode
  [ 1191.055183] #PF: error_code(0x) - not-present page
  [ 1191.056513] PGD 334e15067 P4D 334e15067 PUD 334e17067 PMD 0 
  [ 1191.058016] Oops:  [#1] SMP NOPTI
  [ 1191.058984] CPU: 1 PID: 2557 Comm: ebpf.test Not tainted 6.2.0-1016-azure 
#16~22.04.1-Ubuntu
  [ 1191.061167] Hardware name: Microsoft Corporation Virtual Machine/Virtual 
Machine, BIOS 090008  12/07/2018
  [ 1191.063804] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.065064] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
  [ 1191.069766] RSP: 0018:a64e03053c50 EFLAGS: 00010246
  [ 1191.071117] RAX: 0001 RBX: a64e0005a000 RCX: 
a64e03053c3f
  [ 1191.073415] RDX: 0001 RSI: a64e03053c3f RDI: 
8a468580
  [ 1191.075351] RBP: ea053cf0 R08:  R09: 

  [ 1191.077722] R10:  R11:  R12: 
97dc75673c00
  [ 1191.079681] R13: a64e0005a048 R14: a64e03053d34 R15: 
0001
  [ 1191.081636] FS:  7fd4a2ffd640() GS:97df6fc8() 
knlGS:
  [ 1191.083866] CS:  0010 DS:  ES:  CR0: 80050033
  [ 1191.085455] CR2: ea053c70 CR3: 00019ff80001 CR4: 
00370ee0
  [ 1191.087405] Call Trace:
  [ 1191.088121]  
  [ 1191.088745]  ? show_regs+0x6a/0x80
  [ 1191.089710]  ? __die+0x25/0x70
  [ 1191.090591]  ? page_fault_oops+0x79/0x180
  [ 1191.091708]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.093027]  ? search_exception_tables+0x61/0x70
  [ 1191.094421]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.095686]  ? kernelmode_fixup_or_oops+0xa2/0x120
  [ 1191.097014]  ? __bad_area_nosemaphore+0x16f/0x280
  [ 1191.098323]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.099584]  ? apparmor_file_alloc_security+0x1f/0xd0
  [ 1191.100989]  ? bad_area_nosemaphore+0x16/0x20
  [ 1191.102235]  ? do_kern_addr_fault+0x62/0x80
  [ 1191.103393]  ? exc_page_fault+0xd8/0x160
  [ 1191.104505]  ? asm_exc_page_fault+0x27/0x30
  [ 1191.105669]  ? bpf_test_run+0x104/0x2e0
  [ 1191.106745]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.108010]  ? bpf_prog_test_run_skb+0x2e4/0x4f0
  [ 1191.109350]  ? __fdget+0x13/0x20
  [ 1191.110304]  ? __sys_bpf+0x706/0xea0
  [ 1191.111299]  ? __x64_sys_bpf+0x1a/0x30
  [ 1191.112307]  ? do_syscall_64+0x5c/0x90
  [ 1191.113366]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.114634]  ? exit_to_user_mode_loop+0xec/0x160
  [ 1191.115929]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.117466]  ? __set_task_blocked+0x29/0x70
  [ 1191.118904]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.120482]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.122073]  ? sigprocmask+0xb8/0xe0
  [ 1191.123360]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.124868]  ? exit_to_user_mode_prepare+0x49/0x100
  [ 1191.126523]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.128028]  ? syscall_exit_to_user_mode+0x27/0x40
  [ 1191.129599]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.131033]  ? do_syscall_64+0x69/0x90
  [ 1191.132242]  ? srso_alias_return_thunk+0x5/0x7f
  [ 1191.134199]  ? do_syscall_64+0x69/0x90
  [ 1191.135504]  ? entry_SYSCALL_64_after_hwframe+0x73/0xdd
  [ 1191.137137]  
  [ 1191.137942] Modules linked in: nft_chain_nat xt_MASQUERADE nf_nat 
nf_conntrack_netlink xfrm_user xfrm_algo xt_addrtype br_netfilter bridge stp 
llc xt_tcpudp tls xt_owner xt_conntrack nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink overlay nvme_fabrics 
udf crc_itu_t binfmt_misc nls_iso8859_1 kvm_amd ccp joydev kvm hid_generic 
irqbypass crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha512_ssse3 aesni_intel crypto_simd cryptd hyperv_drm 
drm_kms_helper syscopyarea sysfillrect serio_raw sysimgblt drm_shmem_helper 
hid_hyperv hv_netvsc hid hyperv_keyboard pata_acpi dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore i2c_core ip_tables 
x_tables autofs4
  [ 1191.156484] CR2: ea053c70
  [ 1191.158026] ---[ end trace  ]---
  [ 1191.159518] RIP: 0010:bpf_test_run+0x104/0x2e0
  [ 1191.160912] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 

[Kernel-packages] [Bug 2045778] [NEW] panic due to unhandled page fault via BPF_PROG_RUN syscall

2023-12-06 Thread Lorenz Bauer
Public bug reported:

Here is a kernel oops triggered from user space by invoking a BPF
program:

[ 1191.051531] BUG: unable to handle page fault for address: ea053c70
[ 1191.053848] #PF: supervisor read access in kernel mode
[ 1191.055183] #PF: error_code(0x) - not-present page
[ 1191.056513] PGD 334e15067 P4D 334e15067 PUD 334e17067 PMD 0 
[ 1191.058016] Oops:  [#1] SMP NOPTI
[ 1191.058984] CPU: 1 PID: 2557 Comm: ebpf.test Not tainted 6.2.0-1016-azure 
#16~22.04.1-Ubuntu
[ 1191.061167] Hardware name: Microsoft Corporation Virtual Machine/Virtual 
Machine, BIOS 090008  12/07/2018
[ 1191.063804] RIP: 0010:bpf_test_run+0x104/0x2e0
[ 1191.065064] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
[ 1191.069766] RSP: 0018:a64e03053c50 EFLAGS: 00010246
[ 1191.071117] RAX: 0001 RBX: a64e0005a000 RCX: a64e03053c3f
[ 1191.073415] RDX: 0001 RSI: a64e03053c3f RDI: 8a468580
[ 1191.075351] RBP: ea053cf0 R08:  R09: 
[ 1191.077722] R10:  R11:  R12: 97dc75673c00
[ 1191.079681] R13: a64e0005a048 R14: a64e03053d34 R15: 0001
[ 1191.081636] FS:  7fd4a2ffd640() GS:97df6fc8() 
knlGS:
[ 1191.083866] CS:  0010 DS:  ES:  CR0: 80050033
[ 1191.085455] CR2: ea053c70 CR3: 00019ff80001 CR4: 00370ee0
[ 1191.087405] Call Trace:
[ 1191.088121]  
[ 1191.088745]  ? show_regs+0x6a/0x80
[ 1191.089710]  ? __die+0x25/0x70
[ 1191.090591]  ? page_fault_oops+0x79/0x180
[ 1191.091708]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.093027]  ? search_exception_tables+0x61/0x70
[ 1191.094421]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.095686]  ? kernelmode_fixup_or_oops+0xa2/0x120
[ 1191.097014]  ? __bad_area_nosemaphore+0x16f/0x280
[ 1191.098323]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.099584]  ? apparmor_file_alloc_security+0x1f/0xd0
[ 1191.100989]  ? bad_area_nosemaphore+0x16/0x20
[ 1191.102235]  ? do_kern_addr_fault+0x62/0x80
[ 1191.103393]  ? exc_page_fault+0xd8/0x160
[ 1191.104505]  ? asm_exc_page_fault+0x27/0x30
[ 1191.105669]  ? bpf_test_run+0x104/0x2e0
[ 1191.106745]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.108010]  ? bpf_prog_test_run_skb+0x2e4/0x4f0
[ 1191.109350]  ? __fdget+0x13/0x20
[ 1191.110304]  ? __sys_bpf+0x706/0xea0
[ 1191.111299]  ? __x64_sys_bpf+0x1a/0x30
[ 1191.112307]  ? do_syscall_64+0x5c/0x90
[ 1191.113366]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.114634]  ? exit_to_user_mode_loop+0xec/0x160
[ 1191.115929]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.117466]  ? __set_task_blocked+0x29/0x70
[ 1191.118904]  ? exit_to_user_mode_prepare+0x49/0x100
[ 1191.120482]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.122073]  ? sigprocmask+0xb8/0xe0
[ 1191.123360]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.124868]  ? exit_to_user_mode_prepare+0x49/0x100
[ 1191.126523]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.128028]  ? syscall_exit_to_user_mode+0x27/0x40
[ 1191.129599]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.131033]  ? do_syscall_64+0x69/0x90
[ 1191.132242]  ? srso_alias_return_thunk+0x5/0x7f
[ 1191.134199]  ? do_syscall_64+0x69/0x90
[ 1191.135504]  ? entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 1191.137137]  
[ 1191.137942] Modules linked in: nft_chain_nat xt_MASQUERADE nf_nat 
nf_conntrack_netlink xfrm_user xfrm_algo xt_addrtype br_netfilter bridge stp 
llc xt_tcpudp tls xt_owner xt_conntrack nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink overlay nvme_fabrics 
udf crc_itu_t binfmt_misc nls_iso8859_1 kvm_amd ccp joydev kvm hid_generic 
irqbypass crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha512_ssse3 aesni_intel crypto_simd cryptd hyperv_drm 
drm_kms_helper syscopyarea sysfillrect serio_raw sysimgblt drm_shmem_helper 
hid_hyperv hv_netvsc hid hyperv_keyboard pata_acpi dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore i2c_core ip_tables 
x_tables autofs4
[ 1191.156484] CR2: ea053c70
[ 1191.158026] ---[ end trace  ]---
[ 1191.159518] RIP: 0010:bpf_test_run+0x104/0x2e0
[ 1191.160912] Code: 00 00 48 89 90 50 14 00 00 48 89 b5 60 ff ff ff eb 3e 0f 
1f 44 00 00 48 8b 53 30 4c 89 ee 4c 89 e7 e8 50 8c f8 ff 89 c2 66 90 <48> 8b 45 
80 4d 89 f0 48 8d 4d 8c be 01 00 00 00 48 8d 7d a0 89 10
[ 1191.166336] RSP: 0018:a64e03053c50 EFLAGS: 00010246
[ 1191.168046] RAX: 0001 RBX: a64e0005a000 RCX: a64e03053c3f
[ 1191.170129] RDX: 0001 RSI: a64e03053c3f RDI: 8a468580
[ 1191.172210] RBP: ea053cf0 R08:  R09: 
[ 1191.174546] R10:  R11:  R12: 97dc75673c00
[ 1191.176719] R13: a64e0005a048 R14: a64e03053d34 R15: 

[Kernel-packages] [Bug 1970034] [NEW] Intel nested KVM exits L2 due to TRIPLE_FAULT

2022-04-23 Thread Lorenz Bauer
Public bug reported:

linux-image-5.13.0-39-generic:
  Installed: 5.13.0-39.44~20.04.1

Description:Ubuntu 20.04.1 LTS
Release:20.04

I use qemu to run short lived Linux VMs as part of a CI pipeline, using
nested KVM on Intel CPUs. With good probability, one of the qemu
processes managing the VMs exits without any output. I've been able to
track the behaviour to L1 qemu receiving KVM_EXIT_SHUTDOWN from KVM_RUN
ioctl:

...
15268@1647341556.924605:kvm_run_exit cpu_index 0, reason 2
15268@1647341556.928341:kvm_run_exit cpu_index 0, reason 8

on QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.21)

Digging deeper, I managed to capture the following trace from the L1
kernel (via perf record -a -e "kvm:*"):

...
[001]   770.850287:  kvm:kvm_entry: vcpu 0, rip 0x100146
[001]   770.850307:   kvm:kvm_exit: vcpu 0 reason 
TRIPLE_FAULT rip 0x100146 info1 0x info2 0x 
intr_info 0x error_code 0x
[001]   770.850313:kvm:kvm_fpu: unload
[001]   770.850316: kvm:kvm_userspace_exit: reason 
KVM_EXIT_SHUTDOWN (8)

   on Linux 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10
UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Immediately prior to the triple fault there are a bunch of
EXTERNAL_INTERRUPT and reads / writes of MSRs and CRs. The crash seems
independent of the Linux version running in L2, I see it across a bunch
of LTS kernels. Unfortunately I don't know which version of Linux /
Ubuntu is in L0.

I've tried to reproduce on other machines I have access to, without much
luck. I've also tried to make sense of rip 0x100146 on my own, but I
don't understand x86 / qemu boot enough. Finally, I've tried looking at
commits to KVM between 5.13 and master that mention TRIPLE_FAULT, but
nothing rang a bell.

I've put traces from two failed executions + lscpu at 
https://gist.github.com/lmb/c36479bb67f397ba08319b5e0f752386
For completeness sake, you can see the failing CI runs at 
https://ebpf.semaphoreci.com/branches/317c3f18-4de0-488b-af6d-2a1fa0967f87

I've tried to get help with this issue via k...@vger.kernel.org but had
no luck. See
https://lore.kernel.org/kvm/95c1dc01-4aa0-46a6-95b1-bbc62588a...@www.fastmail.com/

** Affects: linux-meta-hwe-5.13 (Ubuntu)
 Importance: Undecided
 Status: New

** Package changed: ubuntu => linux-meta-hwe-5.13 (Ubuntu)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-meta-hwe-5.13 in Ubuntu.
https://bugs.launchpad.net/bugs/1970034

Title:
  Intel nested KVM exits L2 due to TRIPLE_FAULT

Status in linux-meta-hwe-5.13 package in Ubuntu:
  New

Bug description:
  linux-image-5.13.0-39-generic:
Installed: 5.13.0-39.44~20.04.1

  Description:  Ubuntu 20.04.1 LTS
  Release:  20.04

  I use qemu to run short lived Linux VMs as part of a CI pipeline,
  using nested KVM on Intel CPUs. With good probability, one of the qemu
  processes managing the VMs exits without any output. I've been able to
  track the behaviour to L1 qemu receiving KVM_EXIT_SHUTDOWN from
  KVM_RUN ioctl:

  ...
  15268@1647341556.924605:kvm_run_exit cpu_index 0, reason 2
  15268@1647341556.928341:kvm_run_exit cpu_index 0, reason 8

  on QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.21)

  Digging deeper, I managed to capture the following trace from the L1
  kernel (via perf record -a -e "kvm:*"):

  ...
  [001]   770.850287:  kvm:kvm_entry: vcpu 0, rip 
0x100146
  [001]   770.850307:   kvm:kvm_exit: vcpu 0 reason 
TRIPLE_FAULT rip 0x100146 info1 0x info2 0x 
intr_info 0x error_code 0x
  [001]   770.850313:kvm:kvm_fpu: unload
  [001]   770.850316: kvm:kvm_userspace_exit: reason 
KVM_EXIT_SHUTDOWN (8)

 on Linux 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7
  14:25:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  Immediately prior to the triple fault there are a bunch of
  EXTERNAL_INTERRUPT and reads / writes of MSRs and CRs. The crash seems
  independent of the Linux version running in L2, I see it across a
  bunch of LTS kernels. Unfortunately I don't know which version of
  Linux / Ubuntu is in L0.

  I've tried to reproduce on other machines I have access to, without
  much luck. I've also tried to make sense of rip 0x100146 on my own,
  but I don't understand x86 / qemu boot enough. Finally, I've tried
  looking at commits to KVM between 5.13 and master that mention
  TRIPLE_FAULT, but nothing rang a bell.

  I've put traces from two failed executions + lscpu at 
https://gist.github.com/lmb/c36479bb67f397ba08319b5e0f752386
  For completeness sake, you can see the failing CI runs at 
https://ebpf.semaphoreci.com/branches/317c3f18-4de0-488b-af6d-2a1fa0967f87

  I've tried to get help with this issue via