Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf: test_run: Fix timer mode initialization to NO_MIGRATE mode
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: de73422
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 2486138
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: de73422
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 0db4941
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 56b4d16
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 56b4d16
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 56b4d16
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

By default, the timer mode is being initialized to `NO_PREEMPT`.
This disables preemption and forces execution in atomic context.
This can cause issue with PREEMPT_RT when calling spin_lock_bh() due
to sleeping nature of the lock.
...
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6107, name: syz.0.17
preempt_count: 1, expected: 0
RCU nest depth: 1, expected: 1
Preemption disabled at:
[<ffffffff891fce58>] bpf_test_timer_enter+0xf8/0x140 net/bpf/test_run.c:42
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 __might_resched+0x44b/0x5d0 kernel/sched/core.c:8957
 __rt_spin_lock kernel/locking/spinlock_rt.c:48 [inline]
 rt_spin_lock+0xc7/0x2c0 kernel/locking/spinlock_rt.c:57
 spin_lock_bh include/linux/spinlock_rt.h:88 [inline]
 __sock_map_delete net/core/sock_map.c:421 [inline]
 sock_map_delete_elem+0xb7/0x170 net/core/sock_map.c:452
 bpf_prog_2c29ac5cdc6b1842+0x43/0x4b
 bpf_dispatcher_nop_func include/linux/bpf.h:1332 [inline]
...
Change initialization to NO_MIGRATE mode to prevent this.

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=1f1fbecb9413cdbfbef8
Tested-by: [email protected]
Signed-off-by: Sahil Chandna <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 56b4d16
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1008598 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant