Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Use offsetofend() to simplify macro definition

Use offsetofend() instead of offsetof() + sizeof() to simplify
MIN_BPF_LINEINFO_SIZE macro definition.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/bpf/20220310161518.534544-1-ytcoode@gmail.com

authored by

Yuntao Wang and committed by
Daniel Borkmann
1b773d00 58617014

+1 -2
+1 -2
kernel/bpf/verifier.c
··· 10400 10400 aux->func_info[i].insn_off = env->subprog_info[i].start; 10401 10401 } 10402 10402 10403 - #define MIN_BPF_LINEINFO_SIZE (offsetof(struct bpf_line_info, line_col) + \ 10404 - sizeof(((struct bpf_line_info *)(0))->line_col)) 10403 + #define MIN_BPF_LINEINFO_SIZE offsetofend(struct bpf_line_info, line_col) 10405 10404 #define MAX_LINEINFO_REC_SIZE MAX_FUNCINFO_REC_SIZE 10406 10405 10407 10406 static int check_btf_line(struct bpf_verifier_env *env,