bpf: Forbid trampoline attach for functions with variable arguments
stable inclusion from stable-v5.10.44 commit 584b2c7ce24450a7c687f976b54333607e14e058 bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=399 CVE: NA ------------------------------------------------- [ Upstream commit 31379397 ] We can't currently allow to attach functions with variable arguments. The problem is that we should save all the registers for arguments, which is probably doable, but if caller uses more than 6 arguments, we need stack data, which will be wrong, because of the extra stack frame we do in bpf trampoline, so we could crash. Also currently there's malformed trampoline code generated for such functions at the moment as described in: https://lore.kernel.org/bpf/20210429212834.82621-1-jolsa@kernel.org/Signed-off-by: NJiri Olsa <jolsa@kernel.org> Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net> Acked-by: NAndrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210505132529.401047-1-jolsa@kernel.orgSigned-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nwangruifeng <972063181@qq.com> Reviewed-by: Jian Cheng <cj.chengjian(a)huawei.com> Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Showing
想要评论请 注册 或 登录