Re: [PATCH bpf] libbpf: Check if map names are not NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 20, 2019 at 01:27:42PM +0100, Michal Rostecki wrote:
> BPF maps do not have to be named, so map names can be NULL. Map name
> pointers should be checked before doing any operations which cannot be
> done on NULL pointers.
> 
> This issue was detected by the following errors coming from bpftool
> built with AddressSanitizer:
> 
> bpf.c:256:2: runtime error: null pointer passed as argument 2, which is declared to never be null
> bpf.c:92:2: runtime error: null pointer passed as argument 2, which is declared to never be null
> bpf.c:169:2: runtime error: null pointer passed as argument 2, which is declared to never be null
> 
> Fixes: 88cda1c9da02 ("bpf: libbpf: Provide basic API support to specify BPF obj name")
> Fixes: d7be143b67c2 ("libbpf: Support expected_attach_type at prog load")
> Fixes: 8a138aed4a80 ("bpf: btf: Add BTF support to libbpf")
> Signed-off-by: Michal Rostecki <mrostecki@xxxxxxxxxxxx>

I don't think that's necessary. memcpy is fine with src==null and len==0




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux