History

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. ====================

David S. Miller committed 6 years ago

Commit e708e2b2 parents 0433c93 d92302135 files · +486 −232Browse files

Showing the changes to include/linux (6 of 35 files). Show all

Unified · Split

6 files
  1. include/linux/bpf-netns.h +3 −2
  2. include/linux/bpf.h +11 −2
  3. include/linux/btf.h +5 −0
  4. include/linux/dma-direct.h +1 −0
  5. include/linux/dma-mapping.h +5 −0
  6. include/linux/skmsg.h +13 −0
include/linux/bpf-netns.h+3−2
@@ -33,7 +33,7 @@ int netns_bpf_prog_query(const union bpf_attr *attr, · 32 unmodified lines
33 union bpf_attr __user *uattr);33 union bpf_attr __user *uattr);
34int netns_bpf_prog_attach(const union bpf_attr *attr,34int netns_bpf_prog_attach(const union bpf_attr *attr,
35 struct bpf_prog *prog);35 struct bpf_prog *prog);
36int netns_bpf_prog_detach(const union bpf_attr *attr);36int netns_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
37int netns_bpf_link_create(const union bpf_attr *attr,37int netns_bpf_link_create(const union bpf_attr *attr,
38 struct bpf_prog *prog);38 struct bpf_prog *prog);
39#else39#else
@@ -49,7 +49,8 @@ static inline int netns_bpf_prog_attach(const union bpf_attr *attr, · 9 unmodified lines
49 return -EOPNOTSUPP;49 return -EOPNOTSUPP;
50}50}
51 51
52static inline int netns_bpf_prog_detach(const union bpf_attr *attr)52static inline int netns_bpf_prog_detach(const union bpf_attr *attr,
53 enum bpf_prog_type ptype)
53{54{
54 return -EOPNOTSUPP;55 return -EOPNOTSUPP;
55}56}
include/linux/bpf.h+11−2
@@ -1543,13 +1543,16 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map) · 1542 unmodified lines
1543#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */1543#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */
1544 1544
1545#if defined(CONFIG_BPF_STREAM_PARSER)1545#if defined(CONFIG_BPF_STREAM_PARSER)
1546int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, u32 which);1546int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog,
1547 struct bpf_prog *old, u32 which);
1547int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);1548int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
1549int sock_map_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
1548void sock_map_unhash(struct sock *sk);1550void sock_map_unhash(struct sock *sk);
1549void sock_map_close(struct sock *sk, long timeout);1551void sock_map_close(struct sock *sk, long timeout);
1550#else1552#else
1551static inline int sock_map_prog_update(struct bpf_map *map,1553static inline int sock_map_prog_update(struct bpf_map *map,
1552 struct bpf_prog *prog, u32 which)1554 struct bpf_prog *prog,
1555 struct bpf_prog *old, u32 which)
1553{1556{
1554 return -EOPNOTSUPP;1557 return -EOPNOTSUPP;
1555}1558}
@@ -1559,6 +1562,12 @@ static inline int sock_map_get_from_fd(const union bpf_attr *attr, · 3 unmodified lines
1559{1562{
1560 return -EINVAL;1563 return -EINVAL;
1561}1564}
1565
1566static inline int sock_map_prog_detach(const union bpf_attr *attr,
1567 enum bpf_prog_type ptype)
1568{
1569 return -EOPNOTSUPP;
1570}
1562#endif /* CONFIG_BPF_STREAM_PARSER */1571#endif /* CONFIG_BPF_STREAM_PARSER */
1563 1572
1564#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)1573#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
include/linux/btf.h+5−0
@@ -82,6 +82,11 @@ static inline bool btf_type_is_int(const struct btf_type *t) · 81 unmodified lines
82 return BTF_INFO_KIND(t->info) == BTF_KIND_INT;82 return BTF_INFO_KIND(t->info) == BTF_KIND_INT;
83}83}
84 84
85static inline bool btf_type_is_small_int(const struct btf_type *t)
86{
87 return btf_type_is_int(t) && t->size <= sizeof(u64);
88}
89
85static inline bool btf_type_is_enum(const struct btf_type *t)90static inline bool btf_type_is_enum(const struct btf_type *t)
86{91{
87 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM;92 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM;
include/linux/dma-direct.h+1−0
@@ -87,4 +87,5 @@ int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma, · 86 unmodified lines
87 void *cpu_addr, dma_addr_t dma_addr, size_t size,87 void *cpu_addr, dma_addr_t dma_addr, size_t size,
88 unsigned long attrs);88 unsigned long attrs);
89int dma_direct_supported(struct device *dev, u64 mask);89int dma_direct_supported(struct device *dev, u64 mask);
90bool dma_direct_need_sync(struct device *dev, dma_addr_t dma_addr);
90#endif /* _LINUX_DMA_DIRECT_H */91#endif /* _LINUX_DMA_DIRECT_H */
include/linux/dma-mapping.h+5−0
@@ -461,6 +461,7 @@ int dma_set_mask(struct device *dev, u64 mask); · 460 unmodified lines
461int dma_set_coherent_mask(struct device *dev, u64 mask);461int dma_set_coherent_mask(struct device *dev, u64 mask);
462u64 dma_get_required_mask(struct device *dev);462u64 dma_get_required_mask(struct device *dev);
463size_t dma_max_mapping_size(struct device *dev);463size_t dma_max_mapping_size(struct device *dev);
464bool dma_need_sync(struct device *dev, dma_addr_t dma_addr);
464unsigned long dma_get_merge_boundary(struct device *dev);465unsigned long dma_get_merge_boundary(struct device *dev);
465#else /* CONFIG_HAS_DMA */466#else /* CONFIG_HAS_DMA */
466static inline dma_addr_t dma_map_page_attrs(struct device *dev,467static inline dma_addr_t dma_map_page_attrs(struct device *dev,
@@ -571,6 +572,10 @@ static inline size_t dma_max_mapping_size(struct device *dev) · 104 unmodified lines
571{572{
572 return 0;573 return 0;
573}574}
575static inline bool dma_need_sync(struct device *dev, dma_addr_t dma_addr)
576{
577 return false;
578}
574static inline unsigned long dma_get_merge_boundary(struct device *dev)579static inline unsigned long dma_get_merge_boundary(struct device *dev)
575{580{
576 return 0;581 return 0;
include/linux/skmsg.h+13−0
@@ -430,6 +430,19 @@ static inline void psock_set_prog(struct bpf_prog **pprog, · 429 unmodified lines
430 bpf_prog_put(prog);430 bpf_prog_put(prog);
431}431}
432 432
433static inline int psock_replace_prog(struct bpf_prog **pprog,
434 struct bpf_prog *prog,
435 struct bpf_prog *old)
436{
437 if (cmpxchg(pprog, old, prog) != old)
438 return -ENOENT;
439
440 if (old)
441 bpf_prog_put(old);
442
443 return 0;
444}
445
433static inline void psock_progs_drop(struct sk_psock_progs *progs)446static inline void psock_progs_drop(struct sk_psock_progs *progs)
434{447{
435 psock_set_prog(&progs->msg_parser, NULL);448 psock_set_prog(&progs->msg_parser, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t