diff options
author | Hou Tao <houtao1@huawei.com> | 2023-12-14 05:30:10 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-12-14 05:49:11 +0100 |
commit | dc68540913ac523b46ebda3843cec179362c7a72 (patch) | |
tree | 0b6e496130744349f7e15d3c015e7196e9bb7217 /kernel/bpf/arraymap.c | |
parent | bpf: Reduce the scope of rcu_read_lock when updating fd map (diff) | |
download | linux-dc68540913ac523b46ebda3843cec179362c7a72.tar.xz linux-dc68540913ac523b46ebda3843cec179362c7a72.zip |
bpf: Use GFP_KERNEL in bpf_event_entry_gen()
rcu_read_lock() is no longer held when invoking bpf_event_entry_gen()
which is called by perf_event_fd_array_get_ptr(), so using GFP_KERNEL
instead of GFP_ATOMIC to reduce the possibility of failures due to
out-of-memory.
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231214043010.3458072-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 8d365bda9a8b..b5ec24b3563e 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -1195,7 +1195,7 @@ static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file, { struct bpf_event_entry *ee; - ee = kzalloc(sizeof(*ee), GFP_ATOMIC); + ee = kzalloc(sizeof(*ee), GFP_KERNEL); if (ee) { ee->event = perf_file->private_data; ee->perf_file = perf_file; |