mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-15 11:34:41 +00:00
samples/bpf: Fix wrong allocation size in xdp_router_ipv4_user
prefix_key->data allocates three bytes using alloca(), but four bytes are actually accessed in the program. Signed-off-by: Rong Tao <rongtao@cestc.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/tencent_F9E2E81922B0C181D05B96DAE5AB0ACE6B06@qq.com
This commit is contained in:
parent
b74344cbed
commit
19a2bdbaad
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ static void read_route(struct nlmsghdr *nh, int nll)
|
|||
__be32 gw;
|
||||
} *prefix_value;
|
||||
|
||||
prefix_key = alloca(sizeof(*prefix_key) + 3);
|
||||
prefix_key = alloca(sizeof(*prefix_key) + 4);
|
||||
prefix_value = alloca(sizeof(*prefix_value));
|
||||
|
||||
prefix_key->prefixlen = 32;
|
||||
|
|
Loading…
Add table
Reference in a new issue