* [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
@ 2021-07-15 11:06 Tobias Klauser
2021-07-15 15:17 ` Quentin Monnet
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tobias Klauser @ 2021-07-15 11:06 UTC (permalink / raw)
To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Roman Gushchin
Fixes: 49a086c201a9 ("bpftool: implement prog load command")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
tools/bpf/bpftool/common.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 1828bba19020..dc6daa193557 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -222,6 +222,11 @@ int mount_bpffs_for_pin(const char *name)
int err = 0;
file = malloc(strlen(name) + 1);
+ if (!file) {
+ p_err("mem alloc failed");
+ return -1;
+ }
+
strcpy(file, name);
dir = dirname(file);
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
2021-07-15 11:06 [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin Tobias Klauser
@ 2021-07-15 15:17 ` Quentin Monnet
2021-07-15 15:55 ` Roman Gushchin
2021-07-15 18:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Quentin Monnet @ 2021-07-15 15:17 UTC (permalink / raw)
To: Tobias Klauser, bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Roman Gushchin
2021-07-15 13:06 UTC+0200 ~ Tobias Klauser <tklauser@distanz.ch>
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
2021-07-15 11:06 [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin Tobias Klauser
2021-07-15 15:17 ` Quentin Monnet
@ 2021-07-15 15:55 ` Roman Gushchin
2021-07-15 18:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Roman Gushchin @ 2021-07-15 15:55 UTC (permalink / raw)
To: Tobias Klauser; +Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
On Thu, Jul 15, 2021 at 01:06:09PM +0200, Tobias Klauser wrote:
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Roman Gushchin <guro@fb.com>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
2021-07-15 11:06 [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin Tobias Klauser
2021-07-15 15:17 ` Quentin Monnet
2021-07-15 15:55 ` Roman Gushchin
@ 2021-07-15 18:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-15 18:10 UTC (permalink / raw)
To: Tobias Klauser; +Cc: bpf, ast, daniel, andrii, guro
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
On Thu, 15 Jul 2021 13:06:09 +0200 you wrote:
> Fixes: 49a086c201a9 ("bpftool: implement prog load command")
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
> tools/bpf/bpftool/common.c | 5 +++++
> 1 file changed, 5 insertions(+)
Here is the summary with links:
- [bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin
https://git.kernel.org/bpf/bpf/c/d444b06e4085
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-15 18:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 11:06 [PATCH bpf-next] bpftool: Check malloc return value in mount_bpffs_for_pin Tobias Klauser
2021-07-15 15:17 ` Quentin Monnet
2021-07-15 15:55 ` Roman Gushchin
2021-07-15 18:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.