Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e3bf9b0 authored by David S. Miller's avatar David S. Miller
Browse files


Daniel Borkmann says:

====================
pull-request: bpf 2018-08-18

The following pull-request contains BPF updates for your *net* tree.

The main changes are:

1) Fix a BPF selftest failure in test_cgroup_storage due to rlimit
   restrictions, from Yonghong.

2) Fix a suspicious RCU rcu_dereference_check() warning triggered
   from removing a device's XDP memory allocator by using the correct
   rhashtable lookup function, from Tariq.

3) A batch of BPF sockmap and ULP fixes mainly fixing leaks and races
   as well as enforcing module aliases for ULPs. Another fix for BPF
   map redirect to make them work again with tail calls, from Daniel.

4) Fix XDP BPF samples to unload their programs upon SIGTERM, from Jesper.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3fe49d69 f6069b9a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -543,7 +543,6 @@ struct bpf_redirect_info {
	u32 flags;
	struct bpf_map *map;
	struct bpf_map *map_to_flush;
	unsigned long   map_owner;
	u32 kern_flags;
};

@@ -781,6 +780,8 @@ static inline bool bpf_dump_raw_ok(void)
struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
				       const struct bpf_insn *patch, u32 len);

void bpf_clear_redirect_map(struct bpf_map *map);

static inline bool xdp_return_frame_no_direct(void)
{
	struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info);
+4 −0
Original line number Diff line number Diff line
@@ -2065,6 +2065,10 @@ int tcp_set_ulp_id(struct sock *sk, const int ulp);
void tcp_get_available_ulp(char *buf, size_t len);
void tcp_cleanup_ulp(struct sock *sk);

#define MODULE_ALIAS_TCP_ULP(name)				\
	__MODULE_INFO(alias, alias_userspace, name);		\
	__MODULE_INFO(alias, alias_tcp_ulp, "tcp-ulp-" name)

/* Call BPF_SOCK_OPS program that returns an int. If the return value
 * is < 0, then the BPF op failed (for example if the loaded BPF
 * program does not support the chosen operation or there is no BPF
+2 −3
Original line number Diff line number Diff line
@@ -147,9 +147,8 @@ struct _bpf_dtab_netdev {

#define devmap_ifindex(fwd, map)				\
	(!fwd ? 0 :						\
	 (!map ? 0 :						\
	 ((map->map_type == BPF_MAP_TYPE_DEVMAP) ?		\
	   ((struct _bpf_dtab_netdev *)fwd)->dev->ifindex : 0)))
	  ((struct _bpf_dtab_netdev *)fwd)->dev->ifindex : 0))

#define _trace_xdp_redirect_map(dev, xdp, fwd, map, idx)		\
	 trace_xdp_redirect_map(dev, xdp, devmap_ifindex(fwd, map),	\
+1 −1
Original line number Diff line number Diff line
@@ -1579,7 +1579,7 @@ static bool bpf_prog_array_copy_core(struct bpf_prog_array __rcu *array,
	struct bpf_prog_array_item *item;
	int i = 0;

	item = rcu_dereference(array)->items;
	item = rcu_dereference_check(array, 1)->items;
	for (; item->prog; item++) {
		if (item->prog == &dummy_bpf_prog.prog)
			continue;
+2 −0
Original line number Diff line number Diff line
@@ -479,6 +479,8 @@ static void cpu_map_free(struct bpf_map *map)
	 * It does __not__ ensure pending flush operations (if any) are
	 * complete.
	 */

	bpf_clear_redirect_map(map);
	synchronize_rcu();

	/* To ensure all pending flush operations have completed wait for flush
Loading