mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
bpf: Fix fds_example SIGSEGV error
[ Upstream commit eef8a42d6ce087d1c81c960ae0d14f955b742feb ] The `BPF_LOG_BUF_SIZE`'s value is `UINT32_MAX >> 8`, so define an array with it on stack caused an overflow. Signed-off-by: Wenbo Zhang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
4360d9b560
commit
5908a17b24
1 changed files with 2 additions and 1 deletions
|
|
@ -30,6 +30,8 @@
|
|||
#define BPF_M_MAP 1
|
||||
#define BPF_M_PROG 2
|
||||
|
||||
char bpf_log_buf[BPF_LOG_BUF_SIZE];
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
printf("Usage: fds_example [...]\n");
|
||||
|
|
@ -57,7 +59,6 @@ static int bpf_prog_create(const char *object)
|
|||
BPF_EXIT_INSN(),
|
||||
};
|
||||
size_t insns_cnt = sizeof(insns) / sizeof(struct bpf_insn);
|
||||
char bpf_log_buf[BPF_LOG_BUF_SIZE];
|
||||
struct bpf_object *obj;
|
||||
int prog_fd;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue