Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2020-06-30 The following pull-request contains BPF updates for your *net* tree. We've added 28 non-merge commits during the last 9 day(s) which contain a total of 35 files changed, 486 insertions(+), 232 deletions(-). The main changes are: 1) Fix an incorrect verifier branch elimination for PTR_TO_BTF_ID pointer types, from Yonghong Song. 2) Fix UAPI for sockmap and flow_dissector progs that were ignoring various arguments passed to BPF_PROG_{ATTACH,DETACH}, from Lorenz Bauer & Jakub Sitnicki. 3) Fix broken AF_XDP DMA hacks that are poking into dma-direct and swiotlb internals and integrate it properly into DMA core, from Christoph Hellwig. 4) Fix RCU splat from recent changes to avoid skipping ingress policy when kTLS is enabled, from John Fastabend. 5) Fix BPF ringbuf map to enforce size to be the power of 2 in order for its position masking to work, from Andrii Nakryiko. 6) Fix regression from CAP_BPF work to re-allow CAP_SYS_ADMIN for loading of network programs, from Maciej Żenczykowski. 7) Fix libbpf section name prefix for devmap progs, from Jesper Dangaard Brouer. 8) Fix formatting in UAPI documentation for BPF helpers, from Quentin Monnet. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -25,7 +25,7 @@ struct bpf_iter__netlink {
|
||||
struct netlink_sock *sk;
|
||||
} __attribute__((preserve_access_index));
|
||||
|
||||
static inline struct inode *SOCK_INODE(struct socket *socket)
|
||||
static __attribute__((noinline)) struct inode *SOCK_INODE(struct socket *socket)
|
||||
{
|
||||
return &container_of(socket, struct socket_alloc, socket)->vfs_inode;
|
||||
}
|
||||
|
@@ -55,3 +55,25 @@ int BPF_PROG(test6, __u64 a, void *b, short c, int d, void * e, __u64 f)
|
||||
e == (void *)20 && f == 21;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct bpf_fentry_test_t {
|
||||
struct bpf_fentry_test_t *a;
|
||||
};
|
||||
|
||||
__u64 test7_result = 0;
|
||||
SEC("fentry/bpf_fentry_test7")
|
||||
int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
|
||||
{
|
||||
if (arg == 0)
|
||||
test7_result = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__u64 test8_result = 0;
|
||||
SEC("fentry/bpf_fentry_test8")
|
||||
int BPF_PROG(test8, struct bpf_fentry_test_t *arg)
|
||||
{
|
||||
if (arg->a == 0)
|
||||
test8_result = 1;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -56,3 +56,25 @@ int BPF_PROG(test6, __u64 a, void *b, short c, int d, void *e, __u64 f, int ret)
|
||||
e == (void *)20 && f == 21 && ret == 111;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct bpf_fentry_test_t {
|
||||
struct bpf_fentry_test *a;
|
||||
};
|
||||
|
||||
__u64 test7_result = 0;
|
||||
SEC("fexit/bpf_fentry_test7")
|
||||
int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
|
||||
{
|
||||
if (arg == 0)
|
||||
test7_result = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__u64 test8_result = 0;
|
||||
SEC("fexit/bpf_fentry_test8")
|
||||
int BPF_PROG(test8, struct bpf_fentry_test_t *arg)
|
||||
{
|
||||
if (arg->a == 0)
|
||||
test8_result = 1;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ struct {
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||
__uint(max_entries, 2);
|
||||
__uint(max_entries, 3);
|
||||
__type(key, int);
|
||||
__type(value, int);
|
||||
} sock_skb_opts SEC(".maps");
|
||||
@@ -94,6 +94,12 @@ struct {
|
||||
SEC("sk_skb1")
|
||||
int bpf_prog1(struct __sk_buff *skb)
|
||||
{
|
||||
int *f, two = 2;
|
||||
|
||||
f = bpf_map_lookup_elem(&sock_skb_opts, &two);
|
||||
if (f && *f) {
|
||||
return *f;
|
||||
}
|
||||
return skb->len;
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ int xdp_dummy_prog(struct xdp_md *ctx)
|
||||
/* valid program on DEVMAP entry via SEC name;
|
||||
* has access to egress and ingress ifindex
|
||||
*/
|
||||
SEC("xdp_devmap")
|
||||
SEC("xdp_devmap/map_prog")
|
||||
int xdp_dummy_dm(struct xdp_md *ctx)
|
||||
{
|
||||
char fmt[] = "devmap redirect: dev %u -> dev %u len %u\n";
|
||||
|
Reference in New Issue
Block a user