+6
−5
Loading
stable inclusion from stable-v6.6.35 commit 91cff53136daeff50816b0baeafd38a6976f6209 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9QG81 CVE: CVE-2024-35860 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=91cff53136daeff50816b0baeafd38a6976f6209 -------------------------------- [ Upstream commit 2884dc7d08d98a89d8d65121524bb7533183a63a ] After commit 1a80dbcb2dba, bpf_link can be freed by link->ops->dealloc_deferred, but the code still tests and uses link->ops->dealloc afterward, which leads to a use-after-free as reported by syzbot. Actually, one of them should be sufficient, so just call one of them instead of both. Also add a WARN_ON() in case of any problematic implementation. Fixes: 1a80dbcb2dba ("bpf: support deferring bpf_link dealloc to after RCU grace period") Reported-by:<syzbot+1989ee16d94720836244@syzkaller.appspotmail.com> Signed-off-by:
Cong Wang <cong.wang@bytedance.com> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net> Acked-by:
Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20240602182703.207276-1-xiyou.wangcong@gmail.com Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Tengda Wu <wutengda2@huawei.com> Signed-off-by:
Pu Lehui <pulehui@huawei.com>