bpf, x86: Avoid repeated usage of bpf_prog->aux->stack_depth

[ Upstream commit f4b21ed0b9 ]

Refactor the code to avoid repeated usage of bpf_prog->aux->stack_depth
in do_jit() func. If the private stack is used, the stack_depth will be
0 for that prog. Refactoring make it easy to adjust stack_depth.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20241112163917.2224189-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 881a9c9cb7 ("bpf: Do not audit capability check in do_jit()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Yonghong Song 2024-11-12 08:39:17 -08:00 • committed by Greg Kroah-Hartman
commit 0efcafd48d