netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NULL pointer dereference in libbpf
@ 2021-06-18  9:14 Anton Ivanov
  2021-06-18  9:24 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Ivanov @ 2021-06-18  9:14 UTC (permalink / raw)
  To: netdev

https://elixir.bootlin.com/linux/latest/source/tools/lib/bpf/bpf.c#L91

A string is copied to a pointer destination which has been memset to zero a few lines above.

Brgds,

-- 
Anton R. Ivanov
https://www.kot-begemot.co.uk/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NULL pointer dereference in libbpf
  2021-06-18  9:14 NULL pointer dereference in libbpf Anton Ivanov
@ 2021-06-18  9:24 ` Toke Høiland-Jørgensen
  2021-06-18  9:54   ` Anton Ivanov
  0 siblings, 1 reply; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-06-18  9:24 UTC (permalink / raw)
  To: Anton Ivanov, netdev

Anton Ivanov <anton.ivanov@kot-begemot.co.uk> writes:

> https://elixir.bootlin.com/linux/latest/source/tools/lib/bpf/bpf.c#L91
>
> A string is copied to a pointer destination which has been memset to
> zero a few lines above.

No, it isn't. attr.map_name is an array...

-Toke


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NULL pointer dereference in libbpf
  2021-06-18  9:24 ` Toke Høiland-Jørgensen
@ 2021-06-18  9:54   ` Anton Ivanov
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Ivanov @ 2021-06-18  9:54 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, netdev



On 18/06/2021 10:24, Toke Høiland-Jørgensen wrote:
> Anton Ivanov <anton.ivanov@kot-begemot.co.uk> writes:
> 
>> https://elixir.bootlin.com/linux/latest/source/tools/lib/bpf/bpf.c#L91
>>
>> A string is copied to a pointer destination which has been memset to
>> zero a few lines above.
> 
> No, it isn't. attr.map_name is an array...

Apologies, looking at the wrong struct definition (bpf_create_map_attr instead of bpf_attr).

Best Regards,

> 
> -Toke
> 
> 

-- 
Anton R. Ivanov
https://www.kot-begemot.co.uk/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-18  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  9:14 NULL pointer dereference in libbpf Anton Ivanov
2021-06-18  9:24 ` Toke Høiland-Jørgensen
2021-06-18  9:54   ` Anton Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).