History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Cross-merge bpf fixes after downstream PR. No conflicts. Adjacent changes in: include/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/btf.c kernel/bpf/helpers.c kernel/bpf/syscall.c kernel/bpf/verifier.c kernel/trace/bpf_trace.c mm/slab_common.c tools/include/uapi/linux/bpf.h tools/testing/selftests/bpf/Makefile

Alexei Starovoitov committed 2 years ago

Commit bfa7b5c2 parents c6fb803 ae90f6a1167 files · +15425 −10300Browse files

Showing the changes to include/uapi (2 of 1167 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/bpf.h +8 −8
  2. include/uapi/linux/ublk_cmd.h +7 −1
include/uapi/linux/bpf.h+8−8
@@ -1121,6 +1121,9 @@ enum bpf_attach_type { · 1120 unmodified lines
11211121
11221122 #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
11231123
1124+/* Add BPF_LINK_TYPE(type, name) in bpf_types.h to keep bpf_link_type_strs[]
1125+ * in sync with the definitions below.
1126+ */
11241127 enum bpf_link_type {
11251128 BPF_LINK_TYPE_UNSPEC = 0,
11261129 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
@@ -6045,11 +6048,6 @@ enum { · 4918 unmodified lines
60456048 BPF_F_MARK_ENFORCE = (1ULL << 6),
60466049 };
60476050
6048−/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
6049−enum {
6050− BPF_F_INGRESS = (1ULL << 0),
6051−};
6052−
60536051 /* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
60546052 enum {
60556053 BPF_F_TUNINFO_IPV6 = (1ULL << 0),
@@ -6196,10 +6194,12 @@ enum { · 140 unmodified lines
61966194 BPF_F_BPRM_SECUREEXEC = (1ULL << 0),
61976195 };
61986196
6199−/* Flags for bpf_redirect_map helper */
6197+/* Flags for bpf_redirect and bpf_redirect_map helpers */
62006198 enum {
6201− BPF_F_BROADCAST = (1ULL << 3),
6202− BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
6199+ BPF_F_INGRESS = (1ULL << 0), /* used for skb path */
6200+ BPF_F_BROADCAST = (1ULL << 3), /* used for XDP path */
6201+ BPF_F_EXCLUDE_INGRESS = (1ULL << 4), /* used for XDP path */
6202+#define BPF_F_REDIRECT_FLAGS (BPF_F_INGRESS | BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS)
62036203 };
62046204
62056205 #define __bpf_md_ptr(type, name) \
include/uapi/linux/ublk_cmd.h+7−1
@@ -175,7 +175,13 @@ · 174 unmodified lines
175175 /* use ioctl encoding for uring command */
176176 #define UBLK_F_CMD_IOCTL_ENCODE (1UL << 6)
177177
178−/* Copy between request and user buffer by pread()/pwrite() */
178+/*
179+ * Copy between request and user buffer by pread()/pwrite()
180+ *
181+ * Not available for UBLK_F_UNPRIVILEGED_DEV, otherwise userspace may
182+ * deceive us by not filling request buffer, then kernel uninitialized
183+ * data may be leaked.
184+ */
179185 #define UBLK_F_USER_COPY (1UL << 7)
180186
181187 /*