projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b74344c
)
samples/bpf: Fix wrong allocation size in xdp_router_ipv4_user
author
Rong Tao
<rongtao@cestc.cn>
Tue, 22 Nov 2022 02:32:56 +0000
(10:32 +0800)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Thu, 24 Nov 2022 23:21:29 +0000
(
00:21
+0100)
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
samples/bpf/xdp_router_ipv4_user.c
patch
|
blob
|
history
diff --git
a/samples/bpf/xdp_router_ipv4_user.c
b/samples/bpf/xdp_router_ipv4_user.c
index 683913bbf279763c420d7e70730a6ce5309885f4..9d41db09c4800fd34702ab3fb838fdeee5899b18 100644
(file)
--- a/
samples/bpf/xdp_router_ipv4_user.c
+++ b/
samples/bpf/xdp_router_ipv4_user.c
@@
-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;