From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Subject: [PATCH bpf v2 0/2] Fix for crash due to overwrite in copy_map_value
Date: Wed, 9 Feb 2022 12:33:22 +0530 [thread overview]
Message-ID: <20220209070324.1093182-1-memxor@gmail.com> (raw)
A fix for an oversight in copy_map_value that leads to kernel crash.
Also, a question for BPF developers:
It seems in arraymap.c, we always do check_and_free_timer_in_array after we do
copy_map_value in map_update_elem callback, but the same is not done for
hashtab.c. Is there a specific reason for this difference in behavior, or did I
miss that it happens for hashtab.c as well?
Changlog:
---------
v1 -> v2:
v1: https://lore.kernel.org/bpf/20220209051113.870717-1-memxor@gmail.com
* Fix build error for selftests patch due to missing SYS_PREFIX in bpf tree
Kumar Kartikeya Dwivedi (2):
bpf: Fix crash due to incorrect copy_map_value
selftests/bpf: Add test for bpf_timer overwriting crash
include/linux/bpf.h | 3 +-
.../selftests/bpf/prog_tests/timer_crash.c | 32 +++++++++++
.../testing/selftests/bpf/progs/timer_crash.c | 54 +++++++++++++++++++
3 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/timer_crash.c
create mode 100644 tools/testing/selftests/bpf/progs/timer_crash.c
--
2.35.1
next reply other threads:[~2022-02-09 7:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 7:03 Kumar Kartikeya Dwivedi [this message]
2022-02-09 7:03 ` [PATCH bpf v2 1/2] bpf: Fix crash due to incorrect copy_map_value Kumar Kartikeya Dwivedi
2022-02-09 19:06 ` Yonghong Song
2022-02-09 19:52 ` Kumar Kartikeya Dwivedi
2022-02-10 8:05 ` Yonghong Song
2022-02-10 22:49 ` Alexei Starovoitov
2022-02-10 23:54 ` Yonghong Song
2022-02-11 0:02 ` Kumar Kartikeya Dwivedi
2022-02-11 0:13 ` Yonghong Song
2022-02-11 1:04 ` Yonghong Song
2022-02-09 7:03 ` [PATCH bpf v2 2/2] selftests/bpf: Add test for bpf_timer overwriting crash Kumar Kartikeya Dwivedi
2022-02-09 20:03 ` Kumar Kartikeya Dwivedi
2022-02-10 8:10 ` Yonghong Song
2022-02-11 21:30 ` [PATCH bpf v2 0/2] Fix for crash due to overwrite in copy_map_value patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220209070324.1093182-1-memxor@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.