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:	Mon, 25 Jan 2016 09:56:30 +0800
From:	"Wangnan (F)" <wangnan0@...wei.com>
To:	Alexei Starovoitov <alexei.starovoitov@...il.com>
CC:	<ast@...nel.org>, <acme@...nel.org>,
	<linux-kernel@...r.kernel.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Daniel Borkmann <daniel@...earbox.net>,
	Li Zefan <lizefan@...wei.com>, <pi3orama@....com>
Subject: Re: [PATCH 2/2] perf bpf: Check relocation target section



On 2016/1/23 1:11, Alexei Starovoitov wrote:
> On Fri, Jan 22, 2016 at 09:27:21AM +0000, Wang Nan wrote:
>> Libbpf should check target section before doing relocation to ensure
>> the relocation is correct. If not, a bug in LLVM causes error. See [1].
>> Also, if an incorrect BPF script uses both global variable and
>> map, global variable whould be treated as map and be relocated
>> without error.
>>
>> This patch saves id of map section into obj->efile and compare
>> target section of a relocation symbol against it during relocation.
> ...
>> [1] https://llvm.org/bugs/show_bug.cgi?id=26243
> ...
>> Signed-off-by: Wang Nan <wangnan0@...wei.com>
>>   
>> +		if (sym.st_shndx != maps_shndx) {
>> +			pr_warning("Program '%s' contains non-map related relo data pointing to section %u\n",
>> +				   prog->section_name, sym.st_shndx);
>> +			return -LIBBPF_ERRNO__RELOC;
>> +		}
> May be 'pr_err' instead of 'pr_warning', since such program will fail
> to load by kernel anyway.

Libbpf doesn't issue pr_error even in fatal exception because it doesn't 
define
pr_err at all. It reports error code and let perf deal with error.

Thank you.

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ