linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] bpf: syscall: a possible sleep-in-atomic-context bug in map_update_elem()
@ 2018-08-10 14:07 Jia-Ju Bai
  2018-08-10 14:22 ` Daniel Borkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Jia-Ju Bai @ 2018-08-10 14:07 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, Linux Kernel Mailing List

The kernel may sleep with holding a rcu read lock.

The function call paths (from bottom to top) in Linux-4.16 are:

[FUNC] kmalloc(GFP_KERNEL)
kernel/kthread.c, 283: kmalloc in __kthread_create_on_node
kernel/kthread.c, 365: __kthread_create_on_node in kthread_create_on_node
kernel/bpf/cpumap.c, 368: kthread_create_on_node in __cpu_map_entry_alloc
kernel/bpf/cpumap.c, 490: __cpu_map_entry_alloc in cpu_map_update_elem
kernel/bpf/syscall.c, 724: [FUNC_PTR]cpu_map_update_elem in map_update_elem
kernel/bpf/syscall.c, 723: rcu_read_lock in map_update_elem

Note that [FUNC_PTR] means a function pointer call is used.

I do not find a good way to fix it, so I only report.
This is found by my static analysis tool (DSAC).


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-13  2:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 14:07 [BUG] bpf: syscall: a possible sleep-in-atomic-context bug in map_update_elem() Jia-Ju Bai
2018-08-10 14:22 ` Daniel Borkmann
2018-08-11  1:57   ` Jia-Ju Bai
2018-08-11  5:01     ` Y Song
2018-08-13  2:48       ` Jia-Ju Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).