Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2019-03-29 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Bug fix in BTF deduplication that was mishandling an equivalence comparison, from Andrii. 2) libbpf Makefile fixes to properly link against libelf for the shared object and to actually export AF_XDP's xsk.h header, from Björn. 3) Fix use after free in bpf inode eviction, from Daniel. 4) Fix a bug in skb creation out of cpumap redirect, from Jesper. 5) Remove an unnecessary and triggerable WARN_ONCE() in max number of call stack frames checking in verifier, from Paul. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -5776,6 +5776,53 @@ const struct btf_dedup_test dedup_tests[] = {
|
||||
.dedup_table_size = 1, /* force hash collisions */
|
||||
},
|
||||
},
|
||||
{
|
||||
.descr = "dedup: void equiv check",
|
||||
/*
|
||||
* // CU 1:
|
||||
* struct s {
|
||||
* struct {} *x;
|
||||
* };
|
||||
* // CU 2:
|
||||
* struct s {
|
||||
* int *x;
|
||||
* };
|
||||
*/
|
||||
.input = {
|
||||
.raw_types = {
|
||||
/* CU 1 */
|
||||
BTF_STRUCT_ENC(0, 0, 1), /* [1] struct {} */
|
||||
BTF_PTR_ENC(1), /* [2] ptr -> [1] */
|
||||
BTF_STRUCT_ENC(NAME_NTH(1), 1, 8), /* [3] struct s */
|
||||
BTF_MEMBER_ENC(NAME_NTH(2), 2, 0),
|
||||
/* CU 2 */
|
||||
BTF_PTR_ENC(0), /* [4] ptr -> void */
|
||||
BTF_STRUCT_ENC(NAME_NTH(1), 1, 8), /* [5] struct s */
|
||||
BTF_MEMBER_ENC(NAME_NTH(2), 4, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
BTF_STR_SEC("\0s\0x"),
|
||||
},
|
||||
.expect = {
|
||||
.raw_types = {
|
||||
/* CU 1 */
|
||||
BTF_STRUCT_ENC(0, 0, 1), /* [1] struct {} */
|
||||
BTF_PTR_ENC(1), /* [2] ptr -> [1] */
|
||||
BTF_STRUCT_ENC(NAME_NTH(1), 1, 8), /* [3] struct s */
|
||||
BTF_MEMBER_ENC(NAME_NTH(2), 2, 0),
|
||||
/* CU 2 */
|
||||
BTF_PTR_ENC(0), /* [4] ptr -> void */
|
||||
BTF_STRUCT_ENC(NAME_NTH(1), 1, 8), /* [5] struct s */
|
||||
BTF_MEMBER_ENC(NAME_NTH(2), 4, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
BTF_STR_SEC("\0s\0x"),
|
||||
},
|
||||
.opts = {
|
||||
.dont_resolve_fwds = false,
|
||||
.dedup_table_size = 1, /* force hash collisions */
|
||||
},
|
||||
},
|
||||
{
|
||||
.descr = "dedup: all possible kinds (no duplicates)",
|
||||
.input = {
|
||||
|
||||
@@ -907,6 +907,44 @@
|
||||
.errstr = "call stack",
|
||||
.result = REJECT,
|
||||
},
|
||||
{
|
||||
"calls: stack depth check in dead code",
|
||||
.insns = {
|
||||
/* main */
|
||||
BPF_MOV64_IMM(BPF_REG_1, 0),
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call A */
|
||||
BPF_EXIT_INSN(),
|
||||
/* A */
|
||||
BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 2), /* call B */
|
||||
BPF_MOV64_IMM(BPF_REG_0, 0),
|
||||
BPF_EXIT_INSN(),
|
||||
/* B */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call C */
|
||||
BPF_EXIT_INSN(),
|
||||
/* C */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call D */
|
||||
BPF_EXIT_INSN(),
|
||||
/* D */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call E */
|
||||
BPF_EXIT_INSN(),
|
||||
/* E */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call F */
|
||||
BPF_EXIT_INSN(),
|
||||
/* F */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call G */
|
||||
BPF_EXIT_INSN(),
|
||||
/* G */
|
||||
BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call H */
|
||||
BPF_EXIT_INSN(),
|
||||
/* H */
|
||||
BPF_MOV64_IMM(BPF_REG_0, 0),
|
||||
BPF_EXIT_INSN(),
|
||||
},
|
||||
.prog_type = BPF_PROG_TYPE_XDP,
|
||||
.errstr = "call stack",
|
||||
.result = REJECT,
|
||||
},
|
||||
{
|
||||
"calls: spill into caller stack frame",
|
||||
.insns = {
|
||||
|
||||
Reference in New Issue
Block a user