All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] tools/bpftool: fix attaching flow dissector
@ 2020-11-05 11:52 Lorenz Bauer
  2020-11-05 17:57 ` Song Liu
  2020-11-06  2:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenz Bauer @ 2020-11-05 11:52 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Lorenz Bauer
  Cc: kernel-team, Jiri Benc, netdev, bpf, linux-kernel

My earlier patch to reject non-zero arguments to flow dissector attach
broke attaching via bpftool. Instead of 0 it uses -1 for target_fd.
Fix this by passing a zero argument when attaching the flow dissector.

Fixes: 1b514239e859 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH")
Reported-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
---
 tools/bpf/bpftool/prog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index d942c1e3372c..acdb2c245f0a 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd,
 	}
 
 	if (*attach_type == BPF_FLOW_DISSECTOR) {
-		*mapfd = -1;
+		*mapfd = 0;
 		return 0;
 	}
 
-- 
2.25.1


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

* Re: [PATCH bpf] tools/bpftool: fix attaching flow dissector
  2020-11-05 11:52 [PATCH bpf] tools/bpftool: fix attaching flow dissector Lorenz Bauer
@ 2020-11-05 17:57 ` Song Liu
  2020-11-06  2:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2020-11-05 17:57 UTC (permalink / raw)
  To: Lorenz Bauer
  Cc: Alexei Starovoitov, Daniel Borkmann, kernel-team, Jiri Benc,
	Networking, bpf, open list

On Thu, Nov 5, 2020 at 3:54 AM Lorenz Bauer <lmb@cloudflare.com> wrote:
>
> My earlier patch to reject non-zero arguments to flow dissector attach
> broke attaching via bpftool. Instead of 0 it uses -1 for target_fd.
> Fix this by passing a zero argument when attaching the flow dissector.
>
> Fixes: 1b514239e859 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH")
> Reported-by: Jiri Benc <jbenc@redhat.com>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
>  tools/bpf/bpftool/prog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> index d942c1e3372c..acdb2c245f0a 100644
> --- a/tools/bpf/bpftool/prog.c
> +++ b/tools/bpf/bpftool/prog.c
> @@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd,
>         }
>
>         if (*attach_type == BPF_FLOW_DISSECTOR) {
> -               *mapfd = -1;
> +               *mapfd = 0;
>                 return 0;
>         }
>
> --
> 2.25.1
>

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

* Re: [PATCH bpf] tools/bpftool: fix attaching flow dissector
  2020-11-05 11:52 [PATCH bpf] tools/bpftool: fix attaching flow dissector Lorenz Bauer
  2020-11-05 17:57 ` Song Liu
@ 2020-11-06  2:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-11-06  2:30 UTC (permalink / raw)
  To: Lorenz Bauer; +Cc: ast, daniel, kernel-team, jbenc, netdev, bpf, linux-kernel

Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Thu,  5 Nov 2020 11:52:30 +0000 you wrote:
> My earlier patch to reject non-zero arguments to flow dissector attach
> broke attaching via bpftool. Instead of 0 it uses -1 for target_fd.
> Fix this by passing a zero argument when attaching the flow dissector.
> 
> Fixes: 1b514239e859 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH")
> Reported-by: Jiri Benc <jbenc@redhat.com>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
> 
> [...]

Here is the summary with links:
  - [bpf] tools/bpftool: fix attaching flow dissector
    https://git.kernel.org/bpf/bpf/c/f9b7ff0d7f7a

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] 3+ messages in thread

end of thread, other threads:[~2020-11-06  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 11:52 [PATCH bpf] tools/bpftool: fix attaching flow dissector Lorenz Bauer
2020-11-05 17:57 ` Song Liu
2020-11-06  2:30 ` 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.