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]
Date:   Fri, 20 Nov 2020 10:20:19 -0800
From:   Martin KaFai Lau <kafai@...com>
To:     Andrii Nakryiko <andrii@...nel.org>
CC:     <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
        <daniel@...earbox.net>, <kernel-team@...com>
Subject: Re: [PATCH bpf-next 2/6] libbpf: add internal helper to load BTF
 data by FD

On Thu, Nov 19, 2020 at 03:22:40PM -0800, Andrii Nakryiko wrote:
[ ... ]

> +int btf__get_from_id(__u32 id, struct btf **btf)
> +{
> +	struct btf *res;
> +	int btf_fd;
> +
> +	*btf = NULL;
> +	btf_fd = bpf_btf_get_fd_by_id(id);
> +	if (btf_fd < 0)
> +		return 0;
It should return an error.

> +
> +	res = btf_get_from_fd(btf_fd, NULL);
> +	close(btf_fd);
> +	if (IS_ERR(res))
> +		return PTR_ERR(res);
> +
> +	*btf = res;
> +	return 0;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ