diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-02 20:20:38 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-01-05 11:43:39 -0500 |
| commit | 040ee69226f8a96b7943645d68f41d5d44b5ff7d (patch) | |
| tree | 225bf6fb67c3597b9def19f3412b476db1d6d4fa /include | |
| parent | 9ee332d99e4d5a97548943b81c54668450ce641b (diff) | |
fix "netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'"
Descriptor table is a shared object; it's not a place where you can
stick temporary references to files, especially when we don't need
an opened file at all.
Cc: stable@vger.kernel.org # v4.14
Fixes: 98589a0998b8 ("netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/bpf.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index e55e4255a210..b63a592ad29d 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
| @@ -419,6 +419,8 @@ static inline int bpf_map_attr_numa_node(const union bpf_attr *attr) | |||
| 419 | attr->numa_node : NUMA_NO_NODE; | 419 | attr->numa_node : NUMA_NO_NODE; |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type type); | ||
| 423 | |||
| 422 | #else /* !CONFIG_BPF_SYSCALL */ | 424 | #else /* !CONFIG_BPF_SYSCALL */ |
| 423 | static inline struct bpf_prog *bpf_prog_get(u32 ufd) | 425 | static inline struct bpf_prog *bpf_prog_get(u32 ufd) |
| 424 | { | 426 | { |
| @@ -506,6 +508,12 @@ static inline int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, | |||
| 506 | { | 508 | { |
| 507 | return 0; | 509 | return 0; |
| 508 | } | 510 | } |
| 511 | |||
| 512 | static inline struct bpf_prog *bpf_prog_get_type_path(const char *name, | ||
| 513 | enum bpf_prog_type type) | ||
| 514 | { | ||
| 515 | return ERR_PTR(-EOPNOTSUPP); | ||
| 516 | } | ||
| 509 | #endif /* CONFIG_BPF_SYSCALL */ | 517 | #endif /* CONFIG_BPF_SYSCALL */ |
| 510 | 518 | ||
| 511 | static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, | 519 | static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, |
| @@ -514,6 +522,8 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, | |||
| 514 | return bpf_prog_get_type_dev(ufd, type, false); | 522 | return bpf_prog_get_type_dev(ufd, type, false); |
| 515 | } | 523 | } |
| 516 | 524 | ||
| 525 | bool bpf_prog_get_ok(struct bpf_prog *, enum bpf_prog_type *, bool); | ||
| 526 | |||
| 517 | int bpf_prog_offload_compile(struct bpf_prog *prog); | 527 | int bpf_prog_offload_compile(struct bpf_prog *prog); |
| 518 | void bpf_prog_offload_destroy(struct bpf_prog *prog); | 528 | void bpf_prog_offload_destroy(struct bpf_prog *prog); |
| 519 | 529 | ||
