History

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.

Al Viro committed 8 years ago

Commit 040ee691 parent 9ee332d4 files · +52 −14Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/bpf.h+10−0
@@ -419,6 +419,8 @@ static inline int bpf_map_attr_numa_node(const union bpf_attr *attr) · 418 unmodified lines
419 attr->numa_node : NUMA_NO_NODE;419 attr->numa_node : NUMA_NO_NODE;
420}420}
421 421
422struct 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 */
423static inline struct bpf_prog *bpf_prog_get(u32 ufd)425static 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, · 81 unmodified lines
506{508{
507 return 0;509 return 0;
508}510}
511
512static 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
511static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,519static 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, · 2 unmodified lines
514 return bpf_prog_get_type_dev(ufd, type, false);522 return bpf_prog_get_type_dev(ufd, type, false);
515}523}
516 524
525bool bpf_prog_get_ok(struct bpf_prog *, enum bpf_prog_type *, bool);
526
517int bpf_prog_offload_compile(struct bpf_prog *prog);527int bpf_prog_offload_compile(struct bpf_prog *prog);
518void bpf_prog_offload_destroy(struct bpf_prog *prog);528void bpf_prog_offload_destroy(struct bpf_prog *prog);
519 529