lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Feb 2019 17:30:54 +0100
From:   Maciej Fijalkowski <maciejromanfijalkowski@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH] samples/bpf: Fix dummy program unloading for
 xdp_redirect samples

On Thu, 21 Feb 2019 17:05:39 +0100
Toke Høiland-Jørgensen <toke@...hat.com> wrote:

> The xdp_redirect and xdp_redirect_map sample programs both load a dummy
> program onto the egress interfaces. However, the unload code checks these
> programs against the wrong fd number, and thus refuses to unload them. Fix
> the comparison to avoid this.
> 
> Fixes: 3b7a8ec2dec3 ("samples/bpf: Check the prog id before exiting")
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> ---
>  samples/bpf/xdp_redirect_map_user.c | 2 +-
>  samples/bpf/xdp_redirect_user.c     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/samples/bpf/xdp_redirect_map_user.c b/samples/bpf/xdp_redirect_map_user.c
> index 327226be5a06..1dbe7fd3a1a8 100644
> --- a/samples/bpf/xdp_redirect_map_user.c
> +++ b/samples/bpf/xdp_redirect_map_user.c
> @@ -57,7 +57,7 @@ static void int_exit(int sig)
>  			printf("bpf_get_link_xdp_id failed\n");
>  			exit(1);
>  		}
> -		if (prog_id == curr_prog_id)
> +		if (dummy_prog_id == curr_prog_id)
>  			bpf_set_link_xdp_fd(ifindex_out, -1, xdp_flags);
>  		else if (!curr_prog_id)
>  			printf("couldn't find a prog id on iface OUT\n");
> diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c
> index a5d8ad3129ed..e9054c0269ff 100644
> --- a/samples/bpf/xdp_redirect_user.c
> +++ b/samples/bpf/xdp_redirect_user.c
> @@ -57,7 +57,7 @@ static void int_exit(int sig)
>  			printf("bpf_get_link_xdp_id failed\n");
>  			exit(1);
>  		}
> -		if (prog_id == curr_prog_id)
> +		if (dummy_prog_id == curr_prog_id)
>  			bpf_set_link_xdp_fd(ifindex_out, -1, xdp_flags);
>  		else if (!curr_prog_id)
>  			printf("couldn't find a prog id on iface OUT\n");

It seems that I confused this in last version of patchset...my bad.

Acked-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ