lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170708205750.152ca83e@redhat.com>
Date:   Sat, 8 Jul 2017 20:57:50 +0200
From:   Jesper Dangaard Brouer <brouer@...hat.com>
To:     John Fastabend <john.fastabend@...il.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, andy@...yhouse.net,
        daniel@...earbox.net, ast@...com, brouer@...hat.com
Subject: Re: [RFC PATCH 08/12] bpf: add devmap, a map for storing net device
 references

On Fri, 07 Jul 2017 10:37:12 -0700
John Fastabend <john.fastabend@...il.com> wrote:

> Device map (devmap) is a BPF map, primarily useful for networking
> applications, that uses a key to lookup a reference to a netdevice.
> 
> The map provides a clean way for BPF programs to build virtual port
> to physical port maps. Additionally, it provides a scoping function
> for the redirect action itself allowing multiple optimizations. Future
> patches will leverage the map to provide batching at the XDP layer.
> 
> Another optimization/feature, that is not yet implemented, would be
> to support multiple netdevices per key to support efficient multicast
> and broadcast support.

[...]

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 74ea96e..06073ba 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -1294,6 +1294,14 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id)
>  		    func_id != BPF_FUNC_current_task_under_cgroup)
>  			goto error;
>  		break;
> +	/* devmap returns a pointer to a live net_device ifindex that we cannot
> +	 * allow to be modified from bpf side. So do not allow lookup elemnts
                                                                      ^^^^^^^
Spelling of elements

> +	 * for now.
> +	 */
> +	case BPF_MAP_TYPE_DEVMAP:
> +		if (func_id == BPF_FUNC_map_lookup_elem)
> +			goto error;
> +		break;

Reviewer notice this limitation from the bpf_prog side.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ