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:   Tue, 3 Nov 2020 11:02:15 -0800
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Magnus Karlsson <magnus.karlsson@...il.com>
Cc:     Magnus Karlsson <magnus.karlsson@...el.com>,
        Björn Töpel <bjorn.topel@...el.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Networking <netdev@...r.kernel.org>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf 1/2] libbpf: fix null dereference in xsk_socket__delete

On Tue, Nov 3, 2020 at 1:41 AM Magnus Karlsson
<magnus.karlsson@...il.com> wrote:
>
> From: Magnus Karlsson <magnus.karlsson@...el.com>
>
> Fix a possible null pointer dereference in xsk_socket__delete that
> will occur if a null pointer is fed into the function.
>
> Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices")
> Reported-by: Andrii Nakryiko <andrii.nakryiko@...il.com>
> Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
> ---

Acked-by: Andrii Nakryiko <andrii@...nel.org>

>  tools/lib/bpf/xsk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
> index e3c98c0..504b7a8 100644
> --- a/tools/lib/bpf/xsk.c
> +++ b/tools/lib/bpf/xsk.c
> @@ -891,13 +891,14 @@ int xsk_umem__delete(struct xsk_umem *umem)
>  void xsk_socket__delete(struct xsk_socket *xsk)
>  {
>         size_t desc_sz = sizeof(struct xdp_desc);
> -       struct xsk_ctx *ctx = xsk->ctx;
>         struct xdp_mmap_offsets off;
> +       struct xsk_ctx *ctx;
>         int err;
>
>         if (!xsk)
>                 return;
>
> +       ctx = xsk->ctx;
>         if (ctx->prog_fd != -1) {
>                 xsk_delete_bpf_maps(xsk);
>                 close(ctx->prog_fd);
> --
> 2.7.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ