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

[syzkaller] memory leak in sk_clone_lock #108

Closed
cpaasch opened this issue Nov 12, 2020 · 3 comments
Closed

[syzkaller] memory leak in sk_clone_lock #108

cpaasch opened this issue Nov 12, 2020 · 3 comments
Assignees

Comments

@cpaasch
Copy link
Member

cpaasch commented Nov 12, 2020

Debian GNU/Linux 9 syzkaller ttyS0
Warning: Permanently added '[localhost]:63195' (ECDSA) to the list of known hosts.
executing program
executing program
BUG: memory leak
unreferenced object 0xffff888106cb2e00 (size 2800):
  comm "softirq", pid 0, jiffies 4294868518 (age 20.738s)
  hex dump (first 32 bytes):
    7f 00 00 01 7f 00 00 01 8d 66 17 b4 00 00 00 00  .........f......
    02 00 07 40 00 00 00 00 98 22 cb 06 81 88 ff ff  ...@....."......
  backtrace:
    [<00000000c09ab652>] sk_prot_alloc.isra.0+0x57/0x260 net/core/sock.c:1660
    [<00000000c30d6958>] sk_clone_lock+0x45/0x1410 net/core/sock.c:1863
    [<00000000e4e5abb8>] inet_csk_clone_lock+0x21/0x470 net/ipv4/inet_connection_sock.c:830
    [<00000000aae760df>] tcp_create_openreq_child+0x30/0x1610 net/ipv4/tcp_minisocks.c:460
    [<00000000bf303e2d>] tcp_v4_syn_recv_sock+0xb6/0x1160 net/ipv4/tcp_ipv4.c:1514
    [<00000000cf027ef6>] subflow_syn_recv_sock+0x2be/0x1230 net/mptcp/subflow.c:555
    [<00000000580f0892>] tcp_check_req+0x677/0x1800 net/ipv4/tcp_minisocks.c:772
    [<0000000051f2f392>] tcp_v4_rcv+0x20b7/0x31c0 net/ipv4/tcp_ipv4.c:1973
    [<00000000fc4cae86>] ip_protocol_deliver_rcu+0x65/0x280 net/ipv4/ip_input.c:204
    [<00000000c5d96688>] ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
    [<00000000c5d96688>] NF_HOOK include/linux/netfilter.h:409 [inline]
    [<00000000c5d96688>] ip_local_deliver+0x341/0x4d0 net/ipv4/ip_input.c:252
    [<0000000018353b97>] dst_input include/net/dst.h:447 [inline]
    [<0000000018353b97>] ip_rcv_finish net/ipv4/ip_input.c:428 [inline]
    [<0000000018353b97>] ip_rcv_finish net/ipv4/ip_input.c:414 [inline]
    [<0000000018353b97>] NF_HOOK include/linux/netfilter.h:409 [inline]
    [<0000000018353b97>] ip_rcv+0x126/0x220 net/ipv4/ip_input.c:539
    [<00000000895b6114>] __netif_receive_skb_one_core+0x197/0x1e0 net/core/dev.c:5315
    [<000000005d16798f>] __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
    [<00000000e6c57394>] process_backlog+0x23b/0x7e0 net/core/dev.c:6319
    [<00000000bf4e7124>] napi_poll net/core/dev.c:6763 [inline]
    [<00000000bf4e7124>] net_rx_action+0x421/0xed0 net/core/dev.c:6833
    [<00000000a8290c58>] __do_softirq+0x1b7/0x7fb kernel/softirq.c:298

BUG: memory leak
unreferenced object 0xffff88810432cf00 (size 192):
  comm "softirq", pid 0, jiffies 4294868518 (age 20.738s)
  hex dump (first 32 bytes):
    f0 c8 79 04 81 88 ff ff f0 c8 79 04 81 88 ff ff  ..y.......y.....
    f2 a7 50 9e dd 86 b7 0a c3 b3 24 22 cf 98 f4 42  ..P.......$"...B
  backtrace:
    [<00000000542f543b>] kmalloc include/linux/slab.h:552 [inline]
    [<00000000542f543b>] kzalloc include/linux/slab.h:664 [inline]
    [<00000000542f543b>] subflow_create_ctx net/mptcp/subflow.c:1229 [inline]
    [<00000000542f543b>] subflow_ulp_clone+0x349/0xd80 net/mptcp/subflow.c:1364
    [<00000000d11d87c4>] inet_clone_ulp net/ipv4/inet_connection_sock.c:815 [inline]
    [<00000000d11d87c4>] inet_csk_clone_lock+0x3b6/0x470 net/ipv4/inet_connection_sock.c:858
    [<00000000aae760df>] tcp_create_openreq_child+0x30/0x1610 net/ipv4/tcp_minisocks.c:460
    [<00000000bf303e2d>] tcp_v4_syn_recv_sock+0xb6/0x1160 net/ipv4/tcp_ipv4.c:1514
    [<00000000cf027ef6>] subflow_syn_recv_sock+0x2be/0x1230 net/mptcp/subflow.c:555
    [<00000000580f0892>] tcp_check_req+0x677/0x1800 net/ipv4/tcp_minisocks.c:772
    [<0000000051f2f392>] tcp_v4_rcv+0x20b7/0x31c0 net/ipv4/tcp_ipv4.c:1973
    [<00000000fc4cae86>] ip_protocol_deliver_rcu+0x65/0x280 net/ipv4/ip_input.c:204
    [<00000000c5d96688>] ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
    [<00000000c5d96688>] NF_HOOK include/linux/netfilter.h:409 [inline]
    [<00000000c5d96688>] ip_local_deliver+0x341/0x4d0 net/ipv4/ip_input.c:252
    [<0000000018353b97>] dst_input include/net/dst.h:447 [inline]
    [<0000000018353b97>] ip_rcv_finish net/ipv4/ip_input.c:428 [inline]
    [<0000000018353b97>] ip_rcv_finish net/ipv4/ip_input.c:414 [inline]
    [<0000000018353b97>] NF_HOOK include/linux/netfilter.h:409 [inline]
    [<0000000018353b97>] ip_rcv+0x126/0x220 net/ipv4/ip_input.c:539
    [<00000000895b6114>] __netif_receive_skb_one_core+0x197/0x1e0 net/core/dev.c:5315
    [<000000005d16798f>] __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
    [<00000000e6c57394>] process_backlog+0x23b/0x7e0 net/core/dev.c:6319
    [<00000000bf4e7124>] napi_poll net/core/dev.c:6763 [inline]
    [<00000000bf4e7124>] net_rx_action+0x421/0xed0 net/core/dev.c:6833
    [<00000000a8290c58>] __do_softirq+0x1b7/0x7fb kernel/softirq.c:298
    [<00000000450c8e05>] asm_call_irq_on_stack+0x12/0x20

Reproducer

# {Threaded:false Collide:false Repeat:true RepeatTimes:0 Procs:1 Sandbox: Fault:false FaultCall:-1 FaultNth:0 Leak:true NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false USB:false VhciInjection:false Wifi:false Sysctl:false UseTmpDir:false HandleSegv:false Repro:false Trace:false}
r0 = socket$inet_mptcp(0x2, 0x1, 0x106)
r1 = socket$inet_mptcp(0x2, 0x1, 0x106)
bind$inet(r1, &(0x7f00000013c0)={0x2, 0x4e20, @multicast1}, 0x10)
connect$inet(r1, &(0x7f0000000040)={0x2, 0x0, @loopback}, 0x10)
listen(r1, 0x3)
connect$inet(r0, &(0x7f0000000040)={0x2, 0x4e20, @loopback}, 0x4b)

HEAD:
2d7e2cf ("DO-NOT-MERGE: mptcp: enabled by default") (HEAD, tag: export/20201105T061029, mptcp_net-next/export) (7 days ago)
b05f8b3 ("DO-NOT-MERGE: mptcp: use kmalloc on kasan build") (7 days ago)
10caf37 ("mptcp: track window announced to peer") (7 days ago)
418ca1f ("selftests: mptcp: add ADD_ADDR IPv6 test cases") (7 days ago)
1eedcb8 ("mptcp: send out dedicated ADD_ADDR packet") (7 days ago)
e88e508 ("mptcp: change add_addr_signal type") (7 days ago)
318dfb3 ("mptcp: keep unaccepted MPC subflow into join list") (7 days ago)
11643ff ("selftests: mptcp: add link failure test case") (7 days ago)
a7bd7ed ("mptcp: skip to next candidate if subflow has unacked data") (7 days ago)
bb42d14 ("mptcp: send explicit ack on delayed ack_seq incr") (7 days ago)
36c6e99 ("mptcp: keep track of advertised windows right edge") (7 days ago)
e518da8 ("mptcp: rework poll+nospace handling") (7 days ago)
e81af88 ("mptcp: try to push pending data on snd una updates") (7 days ago)
1cd2228 ("mptcp: move page frag allocation in mptcp_sendmsg()") (7 days ago)
92fd8af ("mptcp: refactor shutdown and close") (7 days ago)
404eb18 ("mptcp: introduce MPTCP snd_nxt") (7 days ago)
8521f48 ("mptcp: add accounting for pending data") (7 days ago)
00637a9 ("mptcp: reduce the arguments of mptcp_sendmsg_frag") (7 days ago)
63f59da ("mptcp: introduce mptcp_schedule_work") (7 days ago)
6f83f99 ("tcp: factor out __tcp_close() helper") (7 days ago)
46e3236 ("mptcp: use tcp_build_frag()") (7 days ago)
b7cfbf9 ("tcp: factor out tcp_build_frag()") (7 days ago)
74c0724 ("bpf:selftests: add bpf_mptcp_sock() verifier tests") (7 days ago)
c82968a ("bpf:selftests: add MPTCP test base") (7 days ago)
238fb24 ("bpf: add 'bpf_mptcp_sock' structure and helper") (7 days ago)
66e7340 ("mptcp: attach subflow socket to parent cgroup") (7 days ago)
2295ca4 ("bpf: expose is_mptcp flag to bpf_tcp_sock") (7 days ago)
b65ca4c ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next") (mptcp_net-next/net-next) (8 days ago)

@cpaasch
Copy link
Member Author

cpaasch commented Nov 17, 2020

Different, but probably the same:

Syzkaller hit 'memory leak in inet_create' bug.

2020/11/16 22:10:29 executed programs: 61
2020/11/16 22:10:44 executed programs: 78
2020/11/16 22:10:58 executed programs: 99
2020/11/16 22:11:17 executed programs: 109
BUG: memory leak
unreferenced object 0xffff88810661e000 (size 4096):
  comm "syz-executor.5", pid 5068, jiffies 4295916275 (age 86.677s)
  hex dump (first 32 bytes):
    00 00 00 00 e0 00 00 02 00 00 00 00 00 00 20 4e  .............. N
    02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............
  backtrace:
    [<00000000b9898130>] kmalloc include/linux/slab.h:557 [inline]
    [<00000000b9898130>] sk_prot_alloc.isra.0+0x1bd/0x260 net/core/sock.c:1666
    [<000000004b8e9e59>] sk_alloc+0x33/0x870 net/core/sock.c:1720
    [<00000000e808c08b>] inet_create net/ipv4/af_inet.c:325 [inline]
    [<00000000e808c08b>] inet_create+0x34e/0xd90 net/ipv4/af_inet.c:248
    [<000000000961befb>] __sock_create+0x3e6/0x6c0 net/socket.c:1427
    [<000000007ec59eaf>] sock_create net/socket.c:1478 [inline]
    [<000000007ec59eaf>] __sys_socket+0xef/0x200 net/socket.c:1520
    [<00000000abfd6bd0>] __do_sys_socket net/socket.c:1529 [inline]
    [<00000000abfd6bd0>] __se_sys_socket net/socket.c:1527 [inline]
    [<00000000abfd6bd0>] __x64_sys_socket+0x6f/0xb0 net/socket.c:1527
    [<00000000b80e0ad4>] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
    [<00000000ff96c59b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



Syzkaller reproducer:
# {Threaded:true Collide:true Repeat:true RepeatTimes:0 Procs:8 Sandbox:none Fault:false FaultCall:-1 FaultNth:0 Leak:true NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false USB:false VhciInjection:false Wifi:false Sysctl:true UseTmpDir:true HandleSegv:true Repro:false Trace:false}
r0 = socket$inet_mptcp(0x2, 0x1, 0x106)
bind$inet(r0, &(0x7f00000013c0)={0x2, 0x4e20, @multicast2}, 0x10)
connect$inet(r0, &(0x7f0000000040)={0x2, 0x4e20, @loopback}, 0x4d)
setsockopt$inet_MCAST_JOIN_GROUP(r0, 0x0, 0x2a, 0x0, 0x0)

@pabeni pabeni self-assigned this Dec 4, 2020
@matttbe
Copy link
Member

matttbe commented Dec 4, 2020

@cpaasch may you check if this patches fix the two issues your reported please?

  • b89ebad: mptcp: plug subflow context memory leak

(soon in the export branch, max 1h)

Thanks Paolo for the fix!

@cpaasch
Copy link
Member Author

cpaasch commented Dec 4, 2020

Yes, issue is fixed!

@cpaasch cpaasch closed this as completed Dec 4, 2020
jenkins-tessares pushed a commit that referenced this issue Jan 28, 2022
arm32 uses software to simulate the instruction replaced
by kprobe. some instructions may be simulated by constructing
assembly functions. therefore, before executing instruction
simulation, it is necessary to construct assembly function
execution environment in C language through binding registers.
after kasan is enabled, the register binding relationship will
be destroyed, resulting in instruction simulation errors and
causing kernel panic.

the kprobe emulate instruction function is distributed in three
files: actions-common.c actions-arm.c actions-thumb.c, so disable
KASAN when compiling these files.

for example, use kprobe insert on cap_capable+20 after kasan
enabled, the cap_capable assembly code is as follows:
<cap_capable>:
e92d47f0	push	{r4, r5, r6, r7, r8, r9, sl, lr}
e1a05000	mov	r5, r0
e280006c	add	r0, r0, #108    ; 0x6c
e1a04001	mov	r4, r1
e1a06002	mov	r6, r2
e59fa090	ldr	sl, [pc, #144]  ;
ebfc7bf8	bl	c03aa4b4 <__asan_load4>
e595706c	ldr	r7, [r5, #108]  ; 0x6c
e2859014	add	r9, r5, #20
......
The emulate_ldr assembly code after enabling kasan is as follows:
c06f1384 <emulate_ldr>:
e92d47f0	push	{r4, r5, r6, r7, r8, r9, sl, lr}
e282803c	add	r8, r2, #60     ; 0x3c
e1a05000	mov	r5, r0
e7e37855	ubfx	r7, r5, #16, #4
e1a00008	mov	r0, r8
e1a09001	mov	r9, r1
e1a04002	mov	r4, r2
ebf35462	bl	c03c6530 <__asan_load4>
e357000f	cmp	r7, #15
e7e36655	ubfx	r6, r5, #12, #4
e205a00f	and	sl, r5, #15
0a000001	beq	c06f13bc <emulate_ldr+0x38>
e0840107	add	r0, r4, r7, lsl #2
ebf3545c	bl	c03c6530 <__asan_load4>
e084010a	add	r0, r4, sl, lsl #2
ebf3545a	bl	c03c6530 <__asan_load4>
e2890010	add	r0, r9, #16
ebf35458	bl	c03c6530 <__asan_load4>
e5990010	ldr	r0, [r9, #16]
e12fff30	blx	r0
e356000f	cm	r6, #15
1a000014	bne	c06f1430 <emulate_ldr+0xac>
e1a06000	mov	r6, r0
e2840040	add	r0, r4, #64     ; 0x40
......

when running in emulate_ldr to simulate the ldr instruction, panic
occurred, and the log is as follows:
Unable to handle kernel NULL pointer dereference at virtual address
00000090
pgd = ecb46400
[00000090] *pgd=2e0fa003, *pmd=00000000
Internal error: Oops: 206 [#1] SMP ARM
PC is at cap_capable+0x14/0xb0
LR is at emulate_ldr+0x50/0xc0
psr: 600d0293 sp : ecd63af8  ip : 00000004  fp : c0a7c30c
r10: 00000000  r9 : c30897f4  r8 : ecd63cd4
r7 : 0000000f  r6 : 0000000a  r5 : e59fa090  r4 : ecd63c98
r3 : c06ae294  r2 : 00000000  r1 : b7611300  r0 : bf4ec008
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 32c5387d  Table: 2d546400  DAC: 55555555
Process bash (pid: 1643, stack limit = 0xecd60190)
(cap_capable) from (kprobe_handler+0x218/0x340)
(kprobe_handler) from (kprobe_trap_handler+0x24/0x48)
(kprobe_trap_handler) from (do_undefinstr+0x13c/0x364)
(do_undefinstr) from (__und_svc_finish+0x0/0x30)
(__und_svc_finish) from (cap_capable+0x18/0xb0)
(cap_capable) from (cap_vm_enough_memory+0x38/0x48)
(cap_vm_enough_memory) from
(security_vm_enough_memory_mm+0x48/0x6c)
(security_vm_enough_memory_mm) from
(copy_process.constprop.5+0x16b4/0x25c8)
(copy_process.constprop.5) from (_do_fork+0xe8/0x55c)
(_do_fork) from (SyS_clone+0x1c/0x24)
(SyS_clone) from (__sys_trace_return+0x0/0x10)
Code: 0050a0e1 6c0080e2 0140a0e1 0260a0e1 (f801f0e7)

Fixes: 35aa1df ("ARM kprobes: instruction single-stepping support")
Fixes: 4210157 ("ARM: 9017/2: Enable KASan for ARM")
Signed-off-by: huangshaobo <huangshaobo6@huawei.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
jenkins-tessares pushed a commit that referenced this issue Nov 17, 2023
Ensure the skb is available in metadata mapping to skbs before tracking the
metadata index for detecting undelivered CQEs. If the metadata index is put
in the tracking list before putting the skb in the map, the metadata index
might be used for detecting undelivered CQEs before the relevant skb is
available in the map, which can lead to a null-ptr-deref.

Log:
    general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] SMP KASAN
    KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
    CPU: 0 PID: 1243 Comm: kworker/0:2 Not tainted 6.6.0-rc4+ #108
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
    Workqueue: events mlx5e_rx_dim_work [mlx5_core]
    RIP: 0010:mlx5e_ptp_napi_poll+0x9a4/0x2290 [mlx5_core]
    Code: 8c 24 38 cc ff ff 4c 8d 3c c1 4c 89 f9 48 c1 e9 03 42 80 3c 31 00 0f 85 97 0f 00 00 4d 8b 3f 49 8d 7f 28 48 89 f9 48 c1 e9 03 <42> 80 3c 31 00 0f 85 8b 0f 00 00 49 8b 47 28 48 85 c0 0f 84 05 07
    RSP: 0018:ffff8884d3c09c88 EFLAGS: 00010206
    RAX: 0000000000000069 RBX: ffff8881160349d8 RCX: 0000000000000005
    RDX: ffffed10218f48cf RSI: 0000000000000004 RDI: 0000000000000028
    RBP: ffff888122707700 R08: 0000000000000001 R09: ffffed109a781383
    R10: 0000000000000003 R11: 0000000000000003 R12: ffff88810c7a7a40
    R13: ffff888122707700 R14: dffffc0000000000 R15: 0000000000000000
    FS:  0000000000000000(0000) GS:ffff8884d3c00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f4f878dd6e0 CR3: 000000014d108002 CR4: 0000000000370eb0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    <IRQ>
    ? die_addr+0x3c/0xa0
    ? exc_general_protection+0x144/0x210
    ? asm_exc_general_protection+0x22/0x30
    ? mlx5e_ptp_napi_poll+0x9a4/0x2290 [mlx5_core]
    ? mlx5e_ptp_napi_poll+0x8f6/0x2290 [mlx5_core]
    __napi_poll.constprop.0+0xa4/0x580
    net_rx_action+0x460/0xb80
    ? _raw_spin_unlock_irqrestore+0x32/0x60
    ? __napi_poll.constprop.0+0x580/0x580
    ? tasklet_action_common.isra.0+0x2ef/0x760
    __do_softirq+0x26c/0x827
    irq_exit_rcu+0xc2/0x100
    common_interrupt+0x7f/0xa0
    </IRQ>
    <TASK>
    asm_common_interrupt+0x22/0x40
    RIP: 0010:__kmem_cache_alloc_node+0xb/0x330
    Code: 41 5d 41 5e 41 5f c3 8b 44 24 14 8b 4c 24 10 09 c8 eb d5 e8 b7 43 ca 01 0f 1f 80 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 57 <41> 56 41 89 d6 41 55 41 89 f5 41 54 49 89 fc 53 48 83 e4 f0 48 83
    RSP: 0018:ffff88812c4079c0 EFLAGS: 00000246
    RAX: 1ffffffff083c7fe RBX: ffff888100042dc0 RCX: 0000000000000218
    RDX: 00000000ffffffff RSI: 0000000000000dc0 RDI: ffff888100042dc0
    RBP: ffff88812c4079c8 R08: ffffffffa0289f96 R09: ffffed1025880ea9
    R10: ffff888138839f80 R11: 0000000000000002 R12: 0000000000000dc0
    R13: 0000000000000100 R14: 000000000000008c R15: ffff8881271fc450
    ? cmd_exec+0x796/0x2200 [mlx5_core]
    kmalloc_trace+0x26/0xc0
    cmd_exec+0x796/0x2200 [mlx5_core]
    mlx5_cmd_do+0x22/0xc0 [mlx5_core]
    mlx5_cmd_exec+0x17/0x30 [mlx5_core]
    mlx5_core_modify_cq_moderation+0x139/0x1b0 [mlx5_core]
    ? mlx5_add_cq_to_tasklet+0x280/0x280 [mlx5_core]
    ? lockdep_set_lock_cmp_fn+0x190/0x190
    ? process_one_work+0x659/0x1220
    mlx5e_rx_dim_work+0x9d/0x100 [mlx5_core]
    process_one_work+0x730/0x1220
    ? lockdep_hardirqs_on_prepare+0x400/0x400
    ? max_active_store+0xf0/0xf0
    ? assign_work+0x168/0x240
    worker_thread+0x70f/0x12d0
    ? __kthread_parkme+0xd1/0x1d0
    ? process_one_work+0x1220/0x1220
    kthread+0x2d9/0x3b0
    ? kthread_complete_and_exit+0x20/0x20
    ret_from_fork+0x2d/0x70
    ? kthread_complete_and_exit+0x20/0x20
    ret_from_fork_asm+0x11/0x20
    </TASK>
    Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay mlx5_ib ib_uverbs ib_core zram zsmalloc mlx5_core fuse
    ---[ end trace 0000000000000000 ]---

Fixes: 3178308 ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20231114215846.5902-11-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
matttbe pushed a commit that referenced this issue Jan 30, 2024
If CONFIG_BPF_JIT_ALWAYS_ON is not set and bpf_jit_enable is 0, there
exist 6 failed tests.

  [root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
  [root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
  [root@linux bpf]# ./test_verifier | grep FAIL
  #106/p inline simple bpf_loop call FAIL
  #107/p don't inline bpf_loop call, flags non-zero FAIL
  #108/p don't inline bpf_loop call, callback non-constant FAIL
  #109/p bpf_loop_inline and a dead func FAIL
  #110/p bpf_loop_inline stack locations for loop vars FAIL
  #111/p inline bpf_loop call in a big program FAIL
  Summary: 768 PASSED, 15 SKIPPED, 6 FAILED

The test log shows that callbacks are not allowed in non-JITed programs,
interpreter doesn't support them yet, thus these tests should be skipped
if jit is disabled.

Add an explicit flag F_NEEDS_JIT_ENABLED to those tests to mark that they
require JIT enabled in bpf_loop_inline.c, check the flag and jit_disabled
at the beginning of do_test_single() to handle this case.

With this patch:

  [root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
  [root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
  [root@linux bpf]# ./test_verifier | grep FAIL
  Summary: 768 PASSED, 21 SKIPPED, 0 FAILED

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240123090351.2207-3-yangtiezhu@loongson.cn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants