Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Several conflicts, seemingly all over the place. I used Stephen Rothwell's sample resolutions for many of these, if not just to double check my own work, so definitely the credit largely goes to him. The NFP conflict consisted of a bug fix (moving operations past the rhashtable operation) while chaning the initial argument in the function call in the moved code. The net/dsa/master.c conflict had to do with a bug fix intermixing of making dsa_master_set_mtu() static with the fixing of the tagging attribute location. cls_flower had a conflict because the dup reject fix from Or overlapped with the addition of port range classifiction. __set_phy_supported()'s conflict was relatively easy to resolve because Andrew fixed it in both trees, so it was just a matter of taking the net-next copy. Or at least I think it was :-) Joe Stringer's fix to the handling of netns id 0 in bpf_sk_lookup() intermixed with changes on how the sdif and caller_net are calculated in these code paths in net-next. The remaining BPF conflicts were largely about the addition of the __bpf_md_ptr stuff in 'net' overlapping with adjustments and additions to the relevant data structure where the MD pointer macros are used. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -156,12 +156,12 @@ static unsigned long long (*bpf_skb_ancestor_cgroup_id)(void *ctx, int level) =
|
||||
(void *) BPF_FUNC_skb_ancestor_cgroup_id;
|
||||
static struct bpf_sock *(*bpf_sk_lookup_tcp)(void *ctx,
|
||||
struct bpf_sock_tuple *tuple,
|
||||
int size, unsigned int netns_id,
|
||||
int size, unsigned long long netns_id,
|
||||
unsigned long long flags) =
|
||||
(void *) BPF_FUNC_sk_lookup_tcp;
|
||||
static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx,
|
||||
struct bpf_sock_tuple *tuple,
|
||||
int size, unsigned int netns_id,
|
||||
int size, unsigned long long netns_id,
|
||||
unsigned long long flags) =
|
||||
(void *) BPF_FUNC_sk_lookup_udp;
|
||||
static int (*bpf_sk_release)(struct bpf_sock *sk) =
|
||||
|
@@ -449,11 +449,11 @@ static struct btf_raw_test raw_tests[] = {
|
||||
/* const void* */ /* [3] */
|
||||
BTF_TYPE_ENC(0, BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 2),
|
||||
/* typedef const void * const_void_ptr */
|
||||
BTF_TYPE_ENC(NAME_TBD, BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 3),
|
||||
/* struct A { */ /* [4] */
|
||||
BTF_TYPEDEF_ENC(NAME_TBD, 3), /* [4] */
|
||||
/* struct A { */ /* [5] */
|
||||
BTF_TYPE_ENC(NAME_TBD, BTF_INFO_ENC(BTF_KIND_STRUCT, 0, 1), sizeof(void *)),
|
||||
/* const_void_ptr m; */
|
||||
BTF_MEMBER_ENC(NAME_TBD, 3, 0),
|
||||
BTF_MEMBER_ENC(NAME_TBD, 4, 0),
|
||||
/* } */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
@@ -511,10 +511,10 @@ static struct btf_raw_test raw_tests[] = {
|
||||
BTF_TYPE_ENC(0, BTF_INFO_ENC(BTF_KIND_CONST, 0, 0), 0),
|
||||
/* const void* */ /* [3] */
|
||||
BTF_TYPE_ENC(0, BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 2),
|
||||
/* typedef const void * const_void_ptr */ /* [4] */
|
||||
BTF_TYPE_ENC(NAME_TBD, BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 3),
|
||||
/* const_void_ptr[4] */ /* [5] */
|
||||
BTF_TYPE_ARRAY_ENC(3, 1, 4),
|
||||
/* typedef const void * const_void_ptr */
|
||||
BTF_TYPEDEF_ENC(NAME_TBD, 3), /* [4] */
|
||||
/* const_void_ptr[4] */
|
||||
BTF_TYPE_ARRAY_ENC(4, 1, 4), /* [5] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0const_void_ptr",
|
||||
@@ -1309,6 +1309,367 @@ static struct btf_raw_test raw_tests[] = {
|
||||
.err_str = "type != 0",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "typedef (invalid name, name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPEDEF_ENC(0, 1), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__int",
|
||||
.str_sec_size = sizeof("\0__int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "typedef_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "typedef (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPEDEF_ENC(NAME_TBD, 1), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__!int",
|
||||
.str_sec_size = sizeof("\0__!int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "typedef_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "ptr type (invalid name, name_off <> 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 1), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__int",
|
||||
.str_sec_size = sizeof("\0__int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "ptr_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "volatile type (invalid name, name_off <> 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_VOLATILE, 0, 0), 1), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__int",
|
||||
.str_sec_size = sizeof("\0__int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "volatile_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "const type (invalid name, name_off <> 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_CONST, 0, 0), 1), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__int",
|
||||
.str_sec_size = sizeof("\0__int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "const_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "restrict type (invalid name, name_off <> 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0, BTF_INFO_ENC(BTF_KIND_PTR, 0, 0), 1), /* [2] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_RESTRICT, 0, 0), 2), /* [3] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__int",
|
||||
.str_sec_size = sizeof("\0__int"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "restrict_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "fwd type (invalid name, name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0, BTF_INFO_ENC(BTF_KIND_FWD, 0, 0), 0), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__skb",
|
||||
.str_sec_size = sizeof("\0__skb"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "fwd_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "fwd type (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_FWD, 0, 0), 0), /* [2] */
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__!skb",
|
||||
.str_sec_size = sizeof("\0__!skb"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "fwd_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "array type (invalid name, name_off <> 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_ARRAY, 0, 0), 0), /* [2] */
|
||||
BTF_ARRAY_ENC(1, 1, 4),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0__skb",
|
||||
.str_sec_size = sizeof("\0__skb"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "array_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "struct type (name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0,
|
||||
BTF_INFO_ENC(BTF_KIND_STRUCT, 0, 1), 4), /* [2] */
|
||||
BTF_MEMBER_ENC(NAME_TBD, 1, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A",
|
||||
.str_sec_size = sizeof("\0A"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "struct_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "struct type (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_STRUCT, 0, 1), 4), /* [2] */
|
||||
BTF_MEMBER_ENC(NAME_TBD, 1, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A!\0B",
|
||||
.str_sec_size = sizeof("\0A!\0B"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "struct_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "struct member (name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0,
|
||||
BTF_INFO_ENC(BTF_KIND_STRUCT, 0, 1), 4), /* [2] */
|
||||
BTF_MEMBER_ENC(NAME_TBD, 1, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A",
|
||||
.str_sec_size = sizeof("\0A"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "struct_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "struct member (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_STRUCT, 0, 1), 4), /* [2] */
|
||||
BTF_MEMBER_ENC(NAME_TBD, 1, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A\0B*",
|
||||
.str_sec_size = sizeof("\0A\0B*"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "struct_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "enum type (name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0,
|
||||
BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1),
|
||||
sizeof(int)), /* [2] */
|
||||
BTF_ENUM_ENC(NAME_TBD, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A\0B",
|
||||
.str_sec_size = sizeof("\0A\0B"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "enum_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "enum type (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(NAME_TBD,
|
||||
BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1),
|
||||
sizeof(int)), /* [2] */
|
||||
BTF_ENUM_ENC(NAME_TBD, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A!\0B",
|
||||
.str_sec_size = sizeof("\0A!\0B"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "enum_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "enum member (invalid name, name_off = 0)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0,
|
||||
BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1),
|
||||
sizeof(int)), /* [2] */
|
||||
BTF_ENUM_ENC(0, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "",
|
||||
.str_sec_size = sizeof(""),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "enum_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
|
||||
{
|
||||
.descr = "enum member (invalid name, invalid identifier)",
|
||||
.raw_types = {
|
||||
BTF_TYPE_INT_ENC(0, BTF_INT_SIGNED, 0, 32, 4), /* [1] */
|
||||
BTF_TYPE_ENC(0,
|
||||
BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1),
|
||||
sizeof(int)), /* [2] */
|
||||
BTF_ENUM_ENC(NAME_TBD, 0),
|
||||
BTF_END_RAW,
|
||||
},
|
||||
.str_sec = "\0A!",
|
||||
.str_sec_size = sizeof("\0A!"),
|
||||
.map_type = BPF_MAP_TYPE_ARRAY,
|
||||
.map_name = "enum_type_check_btf",
|
||||
.key_size = sizeof(int),
|
||||
.value_size = sizeof(int),
|
||||
.key_type_id = 1,
|
||||
.value_type_id = 1,
|
||||
.max_entries = 4,
|
||||
.btf_load_err = true,
|
||||
.err_str = "Invalid name",
|
||||
},
|
||||
{
|
||||
.descr = "arraymap invalid btf key (a bit field)",
|
||||
.raw_types = {
|
||||
|
@@ -72,7 +72,7 @@ int bpf_sk_lookup_test0(struct __sk_buff *skb)
|
||||
return TC_ACT_SHOT;
|
||||
|
||||
tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6);
|
||||
sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0);
|
||||
if (sk)
|
||||
bpf_sk_release(sk);
|
||||
return sk ? TC_ACT_OK : TC_ACT_UNSPEC;
|
||||
@@ -84,7 +84,7 @@ int bpf_sk_lookup_test1(struct __sk_buff *skb)
|
||||
struct bpf_sock_tuple tuple = {};
|
||||
struct bpf_sock *sk;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
if (sk)
|
||||
bpf_sk_release(sk);
|
||||
return 0;
|
||||
@@ -97,7 +97,7 @@ int bpf_sk_lookup_uaf(struct __sk_buff *skb)
|
||||
struct bpf_sock *sk;
|
||||
__u32 family = 0;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
if (sk) {
|
||||
bpf_sk_release(sk);
|
||||
family = sk->family;
|
||||
@@ -112,7 +112,7 @@ int bpf_sk_lookup_modptr(struct __sk_buff *skb)
|
||||
struct bpf_sock *sk;
|
||||
__u32 family;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
if (sk) {
|
||||
sk += 1;
|
||||
bpf_sk_release(sk);
|
||||
@@ -127,7 +127,7 @@ int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb)
|
||||
struct bpf_sock *sk;
|
||||
__u32 family;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
sk += 1;
|
||||
if (sk)
|
||||
bpf_sk_release(sk);
|
||||
@@ -139,7 +139,7 @@ int bpf_sk_lookup_test2(struct __sk_buff *skb)
|
||||
{
|
||||
struct bpf_sock_tuple tuple = {};
|
||||
|
||||
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ int bpf_sk_lookup_test3(struct __sk_buff *skb)
|
||||
struct bpf_sock_tuple tuple = {};
|
||||
struct bpf_sock *sk;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
bpf_sk_release(sk);
|
||||
bpf_sk_release(sk);
|
||||
return 0;
|
||||
@@ -161,7 +161,7 @@ int bpf_sk_lookup_test4(struct __sk_buff *skb)
|
||||
struct bpf_sock_tuple tuple = {};
|
||||
struct bpf_sock *sk;
|
||||
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
bpf_sk_release(sk);
|
||||
return 0;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ int bpf_sk_lookup_test4(struct __sk_buff *skb)
|
||||
void lookup_no_release(struct __sk_buff *skb)
|
||||
{
|
||||
struct bpf_sock_tuple tuple = {};
|
||||
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), 0, 0);
|
||||
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
|
||||
}
|
||||
|
||||
SEC("fail_no_release_subcall")
|
||||
|
@@ -8633,7 +8633,7 @@ static struct bpf_test tests[] = {
|
||||
BPF_JMP_IMM(BPF_JA, 0, 0, -7),
|
||||
},
|
||||
.fixup_map_hash_8b = { 4 },
|
||||
.errstr = "R0 invalid mem access 'inv'",
|
||||
.errstr = "unbounded min value",
|
||||
.result = REJECT,
|
||||
},
|
||||
{
|
||||
@@ -10604,7 +10604,7 @@ static struct bpf_test tests[] = {
|
||||
"check deducing bounds from const, 5",
|
||||
.insns = {
|
||||
BPF_MOV64_IMM(BPF_REG_0, 0),
|
||||
BPF_JMP_IMM(BPF_JSGE, BPF_REG_0, 0, 1),
|
||||
BPF_JMP_IMM(BPF_JSGE, BPF_REG_0, 1, 1),
|
||||
BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
||||
BPF_EXIT_INSN(),
|
||||
},
|
||||
@@ -14287,7 +14287,7 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
|
||||
|
||||
reject_from_alignment = fd_prog < 0 &&
|
||||
(test->flags & F_NEEDS_EFFICIENT_UNALIGNED_ACCESS) &&
|
||||
strstr(bpf_vlog, "Unknown alignment.");
|
||||
strstr(bpf_vlog, "misaligned");
|
||||
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
if (reject_from_alignment) {
|
||||
printf("FAIL\nFailed due to alignment despite having efficient unaligned access: '%s'!\n",
|
||||
|
Reference in New Issue
Block a user