History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller: "A decent batch of fixes here. I'd say about half are for problems that have existed for a while, and half are for new regressions added in the 4.20 merge window. 1) Fix 10G SFP phy module detection in mvpp2, from Baruch Siach. 2) Revert bogus emac driver change, from Benjamin Herrenschmidt. 3) Handle BPF exported data structure with pointers when building 32-bit userland, from Daniel Borkmann. 4) Memory leak fix in act_police, from Davide Caratti. 5) Check RX checksum offload in RX descriptors properly in aquantia driver, from Dmitry Bogdanov. 6) SKB unlink fix in various spots, from Edward Cree. 7) ndo_dflt_fdb_dump() only works with ethernet, enforce this, from Eric Dumazet. 8) Fix FID leak in mlxsw driver, from Ido Schimmel. 9) IOTLB locking fix in vhost, from Jean-Philippe Brucker. 10) Fix SKB truesize accounting in ipv4/ipv6/netfilter frag memory limits otherwise namespace exit can hang. From Jiri Wiesner. 11) Address block parsing length fixes in x25 from Martin Schiller. 12) IRQ and ring accounting fixes in bnxt_en, from Michael Chan. 13) For tun interfaces, only iface delete works with rtnl ops, enforce this by disallowing add. From Nicolas Dichtel. 14) Use after free in liquidio, from Pan Bian. 15) Fix SKB use after passing to netif_receive_skb(), from Prashant Bhole. 16) Static key accounting and other fixes in XPS from Sabrina Dubroca. 17) Partially initialized flow key passed to ip6_route_output(), from Shmulik Ladkani. 18) Fix RTNL deadlock during reset in ibmvnic driver, from Thomas Falcon. 19) Several small TCP fixes (off-by-one on window probe abort, NULL deref in tail loss probe, SNMP mis-estimations) from Yuchung Cheng" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (93 commits) net/sched: cls_flower: Reject duplicated rules also under skip_sw bnxt_en: Fix _bnxt_get_max_rings() for 57500 chips. bnxt_en: Fix NQ/CP rings accounting on the new 57500 chips. bnxt_en: Keep track of reserved IRQs. bnxt_en: Fix CNP CoS queue regression. net/mlx4_core: Correctly set PFC param if global pause is turned off. Revert "net/ibm/emac: wrong bit is used for STA control" neighbour: Avoid writing before skb->head in neigh_hh_output() ipv6: Check available headroom in ip6_xmit() even without options tcp: lack of available data can also cause TSO defer ipv6: sr: properly initialize flowi6 prior passing to ip6_route_output mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl mlxsw: spectrum_router: Relax GRE decap matching check mlxsw: spectrum_switchdev: Avoid leaking FID's reference count mlxsw: spectrum_nve: Remove easily triggerable warnings ipv4: ipv6: netfilter: Adjust the frag mem limit when truesize changes sctp: frag_point sanity check tcp: fix NULL ref in tail loss probe tcp: Do not underestimate rwnd_limited net: use skb_list_del_init() to remove from RX sublists ...

Linus Torvalds committed 7 years ago

Commit d48f7822 parents 8586ca8 35cc3ce83 files · +1225 −368Browse files

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

Unified · Split

include/uapi/linux/bpf.h+37−19
@@ -2170,7 +2170,7 @@ union bpf_attr { · 2169 unmodified lines
21702170 * Return
21712171 * 0 on success, or a negative error in case of failure.
21722172 *
2173− * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
2173+ * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
21742174 * Description
21752175 * Look for TCP socket matching *tuple*, optionally in a child
21762176 * network namespace *netns*. The return value must be checked,
@@ -2187,12 +2187,14 @@ union bpf_attr { · 10 unmodified lines
21872187 * **sizeof**\ (*tuple*\ **->ipv6**)
21882188 * Look for an IPv6 socket.
21892189 *
2190− * If the *netns* is zero, then the socket lookup table in the
2191− * netns associated with the *ctx* will be used. For the TC hooks,
2192− * this in the netns of the device in the skb. For socket hooks,
2193− * this in the netns of the socket. If *netns* is non-zero, then
2194− * it specifies the ID of the netns relative to the netns
2195− * associated with the *ctx*.
2190+ * If the *netns* is a negative signed 32-bit integer, then the
2191+ * socket lookup table in the netns associated with the *ctx* will
2192+ * will be used. For the TC hooks, this is the netns of the device
2193+ * in the skb. For socket hooks, this is the netns of the socket.
2194+ * If *netns* is any other signed 32-bit value greater than or
2195+ * equal to zero then it specifies the ID of the netns relative to
2196+ * the netns associated with the *ctx*. *netns* values beyond the
2197+ * range of 32-bit integers are reserved for future use.
21962198 *
21972199 * All values for *flags* are reserved for future usage, and must
21982200 * be left at zero.
@@ -2201,8 +2203,10 @@ union bpf_attr { · 2 unmodified lines
22012203 * **CONFIG_NET** configuration option.
22022204 * Return
22032205 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2206+ * For sockets with reuseport option, the *struct bpf_sock*
2207+ * result is from reuse->socks[] using the hash of the tuple.
22042208 *
2205− * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
2209+ * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
22062210 * Description
22072211 * Look for UDP socket matching *tuple*, optionally in a child
22082212 * network namespace *netns*. The return value must be checked,
@@ -2219,12 +2223,14 @@ union bpf_attr { · 10 unmodified lines
22192223 * **sizeof**\ (*tuple*\ **->ipv6**)
22202224 * Look for an IPv6 socket.
22212225 *
2222− * If the *netns* is zero, then the socket lookup table in the
2223− * netns associated with the *ctx* will be used. For the TC hooks,
2224− * this in the netns of the device in the skb. For socket hooks,
2225− * this in the netns of the socket. If *netns* is non-zero, then
2226− * it specifies the ID of the netns relative to the netns
2227− * associated with the *ctx*.
2226+ * If the *netns* is a negative signed 32-bit integer, then the
2227+ * socket lookup table in the netns associated with the *ctx* will
2228+ * will be used. For the TC hooks, this is the netns of the device
2229+ * in the skb. For socket hooks, this is the netns of the socket.
2230+ * If *netns* is any other signed 32-bit value greater than or
2231+ * equal to zero then it specifies the ID of the netns relative to
2232+ * the netns associated with the *ctx*. *netns* values beyond the
2233+ * range of 32-bit integers are reserved for future use.
22282234 *
22292235 * All values for *flags* are reserved for future usage, and must
22302236 * be left at zero.
@@ -2233,6 +2239,8 @@ union bpf_attr { · 2 unmodified lines
22332239 * **CONFIG_NET** configuration option.
22342240 * Return
22352241 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2242+ * For sockets with reuseport option, the *struct bpf_sock*
2243+ * result is from reuse->socks[] using the hash of the tuple.
22362244 *
22372245 * int bpf_sk_release(struct bpf_sock *sk)
22382246 * Description
@@ -2405,6 +2413,9 @@ enum bpf_func_id { · 166 unmodified lines
24052413 /* BPF_FUNC_perf_event_output for sk_buff input context. */
24062414 #define BPF_F_CTXLEN_MASK (0xfffffULL << 32)
24072415
2416+/* Current network namespace */
2417+#define BPF_F_CURRENT_NETNS (-1L)
2418+
24082419 /* Mode for BPF_FUNC_skb_adjust_room helper. */
24092420 enum bpf_adj_room_mode {
24102421 BPF_ADJ_ROOM_NET,
@@ -2422,6 +2433,12 @@ enum bpf_lwt_encap_mode { · 11 unmodified lines
24222433 BPF_LWT_ENCAP_SEG6_INLINE
24232434 };
24242435
2436+#define __bpf_md_ptr(type, name) \
2437+union { \
2438+ type name; \
2439+ __u64 :64; \
2440+} __attribute__((aligned(8)))
2441+
24252442 /* user accessible mirror of in-kernel sk_buff.
24262443 * new fields can only be added to the end of this structure
24272444 */
@@ -2456,7 +2473,7 @@ struct __sk_buff { · 28 unmodified lines
24562473 /* ... here. */
24572474
24582475 __u32 data_meta;
2459− struct bpf_flow_keys *flow_keys;
2476+ __bpf_md_ptr(struct bpf_flow_keys *, flow_keys);
24602477 };
24612478
24622479 struct bpf_tunnel_key {
@@ -2572,8 +2589,8 @@ enum sk_action { · 109 unmodified lines
25722589 * be added to the end of this structure
25732590 */
25742591 struct sk_msg_md {
2575− void *data;
2576− void *data_end;
2592+ __bpf_md_ptr(void *, data);
2593+ __bpf_md_ptr(void *, data_end);
25772594
25782595 __u32 family;
25792596 __u32 remote_ip4; /* Stored in network byte order */
@@ -2589,8 +2606,9 @@ struct sk_reuseport_md { · 9 unmodified lines
25892606 * Start of directly accessible data. It begins from
25902607 * the tcp/udp header.
25912608 */
2592− void *data;
2593− void *data_end; /* End of directly accessible data */
2609+ __bpf_md_ptr(void *, data);
2610+ /* End of directly accessible data */
2611+ __bpf_md_ptr(void *, data_end);
25942612 /*
25952613 * Total length of packet (starting from the tcp/udp header).
25962614 * Note that the directly accessible bytes (data_end - data)