linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] perf: Reconsider an error code selection in bpf_map__fprintf()
@ 2024-02-01 18:21 Markus Elfring
  2024-02-02  6:48 ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2024-02-01 18:21 UTC (permalink / raw)
  To: linux-perf-users, kernel-janitors, Adrian Hunter,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Ian Rogers,
	Ingo Molnar, Jiri Olsa, Mark Rutland, Peter Zijlstra
  Cc: LKML

Hello,

A null pointer check is performed for the input parameter “map”.
It looks suspicious that the function “PTR_ERR” is applied then for
a corresponding return statement.
https://elixir.bootlin.com/linux/v6.8-rc2/source/tools/perf/util/bpf_map.c#L29
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/bpf_map.c?h=v6.8-rc2&id=41bccc98fb7931d63d03f326a746ac4d429c1dd3#n29

This issue was detected by using the Coccinelle software.

Would any other error code determination be more appropriate here?

Regards,
Markus

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

* Re: [RFC] perf: Reconsider an error code selection in bpf_map__fprintf()
  2024-02-01 18:21 [RFC] perf: Reconsider an error code selection in bpf_map__fprintf() Markus Elfring
@ 2024-02-02  6:48 ` Markus Elfring
  2024-02-06  2:12   ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2024-02-02  6:48 UTC (permalink / raw)
  To: linux-perf-users, kernel-janitors, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov, Andrii Nakryiko,
	Arnaldo Carvalho de Melo, Christy Lee, Daniel Borkmann,
	Ian Rogers, Ingo Molnar, Jiri Olsa, John Fastabend, KP Singh,
	Mark Rutland, Martin KaFai Lau, Namhyung Kim, Peter Zijlstra,
	Song Liu, Yonghong Song, YueHaibing, bpf, netdev
  Cc: LKML

> A null pointer check is performed for the input parameter “map”.
> It looks suspicious that the function “PTR_ERR” is applied then for
> a corresponding return statement.

Are contributions also by YueHaibing still waiting on further development considerations?

[PATCH -next] perf: Fix pass 0 to PTR_ERR
https://lore.kernel.org/lkml/20220611040719.8160-1-yuehaibing@huawei.com/
https://lkml.org/lkml/2022/6/11/3


Regards,
Markus

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

* Re: [RFC] perf: Reconsider an error code selection in bpf_map__fprintf()
  2024-02-02  6:48 ` Markus Elfring
@ 2024-02-06  2:12   ` Namhyung Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2024-02-06  2:12 UTC (permalink / raw)
  To: Markus Elfring
  Cc: linux-perf-users, kernel-janitors, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov, Andrii Nakryiko,
	Arnaldo Carvalho de Melo, Christy Lee, Daniel Borkmann,
	Ian Rogers, Ingo Molnar, Jiri Olsa, John Fastabend, KP Singh,
	Mark Rutland, Martin KaFai Lau, Peter Zijlstra, Song Liu,
	Yonghong Song, YueHaibing, bpf, netdev, LKML

Hello,

On Thu, Feb 1, 2024 at 10:49 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > A null pointer check is performed for the input parameter “map”.
> > It looks suspicious that the function “PTR_ERR” is applied then for
> > a corresponding return statement.
>
> Are contributions also by YueHaibing still waiting on further development considerations?
>
> [PATCH -next] perf: Fix pass 0 to PTR_ERR
> https://lore.kernel.org/lkml/20220611040719.8160-1-yuehaibing@huawei.com/
> https://lkml.org/lkml/2022/6/11/3

I think we dropped the bpf-loader and it seems bpf_map.[ch] is
leftover.  I don't see any users of bpf_map__fprintf() in the tree.
Maybe we can drop it too.

Thanks,
Namhyung

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

end of thread, other threads:[~2024-02-06  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 18:21 [RFC] perf: Reconsider an error code selection in bpf_map__fprintf() Markus Elfring
2024-02-02  6:48 ` Markus Elfring
2024-02-06  2:12   ` Namhyung Kim

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).