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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 26 Nov 2016 09:12:19 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Wang Nan <wangnan0@...wei.com>
Cc:     acme@...hat.com, ast@...com, lizefan@...wei.com,
        hekuang@...wei.com, linux-kernel@...r.kernel.org, pi3orama@....com,
        joe@....org, Alexei Starovoitov <ast@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH v3 03/30] tools lib bpf: Retrive bpf_map through offset
 of bpf_map_def

On Sat, Nov 26, 2016 at 07:03:27AM +0000, Wang Nan wrote:
> Add a new API to libbpf, caller is able to get bpf_map through the
> offset of bpf_map_def to 'maps' section.
> 
> The API will be used to help jitted perf hook code find fd of a map.
> 
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
...
> +struct bpf_map *
> +bpf_object__find_map_by_offset(struct bpf_object *obj, size_t offset)
> +{
> +	int i;
> +
> +	for (i = 0; i < obj->nr_maps; i++) {
> +		if (obj->maps[i].offset == offset)
> +			return &obj->maps[i];
> +	}
> +	return ERR_PTR(-ENOENT);
> +}

Acked-by: Alexei Starovoitov <ast@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ