+11
−3
+5
−5
+1
−1
+1
−1
+2
−2
Loading
stable inclusion from stable-v6.6.59 commit 8a33a047bd31a7047b8dffe688c2c10e1ab871eb category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB2SUA CVE: CVE-2024-50164 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8a33a047bd31a7047b8dff -------------------------------- [ Upstream commit 6fad274f06f038c29660aa53fbad14241c9fd976 ] Add a MEM_WRITE attribute for BPF helper functions which can be used in bpf_func_proto to annotate an argument type in order to let the verifier know that the helper writes into the memory passed as an argument. In the past MEM_UNINIT has been (ab)used for this function, but the latter merely tells the verifier that the passed memory can be uninitialized. There have been bugs with overloading the latter but aside from that there are also cases where the passed memory is read + written which currently cannot be expressed, see also 4b3786a6c539 ("bpf: Zero former ARG_PTR_TO_{LONG,INT} args in case of error"). Signed-off-by:Daniel Borkmann <daniel@iogearbox.net> Acked-by:
Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20241021152809.33343-1-daniel@iogearbox.net Signed-off-by:
Alexei Starovoitov <ast@kernel.org> Stable-dep-of: 8ea607330a39 ("bpf: Fix overloading of MEM_UNINIT's meaning") Signed-off-by:
Sasha Levin <sashal@kernel.org> Conflicts: include/linux/bpf.h [The conflicts were due to not merge the commit d8747fd2837aa] Signed-off-by:
Xiaomeng Zhang <zhangxiaomeng13@huawei.com>