diff options
author | Yonghong Song | 2018-01-23 07:53:51 +0100 |
---|---|---|
committer | Daniel Borkmann | 2018-01-23 17:33:57 +0100 |
commit | 2310035fa03f651dd5b03f19a26a97512aa8842c (patch) | |
tree | 8758454fd5163b0ede4fa9a925b797d9e67d30aa /fs/Kconfig | |
parent | net: aquantia: make symbol hw_atl_boards static (diff) | |
download | kernel-qcow2-linux-2310035fa03f651dd5b03f19a26a97512aa8842c.tar.gz kernel-qcow2-linux-2310035fa03f651dd5b03f19a26a97512aa8842c.tar.xz kernel-qcow2-linux-2310035fa03f651dd5b03f19a26a97512aa8842c.zip |
bpf: fix incorrect kmalloc usage in lpm_trie MAP_GET_NEXT_KEY rcu region
In commit b471f2f1de8b ("bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE map"),
the implemented MAP_GET_NEXT_KEY callback function is guarded with rcu read lock.
In the function body, "kmalloc(size, GFP_USER | __GFP_NOWARN)" is used which may
sleep and violate rcu read lock region requirements. This patch fixed the issue
by using GFP_ATOMIC instead to avoid blocking kmalloc. Tested with
CONFIG_DEBUG_ATOMIC_SLEEP=y as suggested by Eric Dumazet.
Fixes: b471f2f1de8b ("bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE map")
Signed-off-by: Yonghong Song <yhs@fb.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'fs/Kconfig')
0 files changed, 0 insertions, 0 deletions