]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: make padding in bpf_tunnel_key explicit
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 29 Mar 2016 22:02:00 +0000 (00:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Mar 2016 23:01:33 +0000 (19:01 -0400)
commitff285a2cb05e501fb319072bdc27149624a4523a
treedb1be8dd13abe309bf54325b307bd1658ed19d7e
parentddb1d5e9f7a50bd1e06b7cc7f64650ecb382a601
bpf: make padding in bpf_tunnel_key explicit

Make the 2 byte padding in struct bpf_tunnel_key between tunnel_ttl
and tunnel_label members explicit. No issue has been observed, and
gcc/llvm does padding for the old struct already, where tunnel_label
was not yet present, so the current code works, but since it's part
of uapi, make sure we don't introduce holes in structs.

Therefore, add tunnel_ext that we can use generically in future
(f.e. to flag OAM messages for backends, etc). Also add the offset
to the compat tests to be sure should some compilers not padd the
tail of the old version of bpf_tunnel_key.

Fixes: a579c2c3e469 ("bpf: support flow label for bpf_skb_{set, get}_tunnel_key")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/bpf.h
net/core/filter.c