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]
Message-ID: <8735a1zdrt.fsf@toke.dk>
Date:   Tue, 29 Nov 2022 21:50:14 +0100
From:   Toke Høiland-Jørgensen <toke@...hat.com>
To:     Stanislav Fomichev <sdf@...gle.com>, bpf@...r.kernel.org
Cc:     ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
        martin.lau@...ux.dev, song@...nel.org, yhs@...com,
        john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com,
        haoluo@...gle.com, jolsa@...nel.org,
        David Ahern <dsahern@...il.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Willem de Bruijn <willemb@...gle.com>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Anatoly Burakov <anatoly.burakov@...el.com>,
        Alexander Lobakin <alexandr.lobakin@...el.com>,
        Magnus Karlsson <magnus.karlsson@...il.com>,
        Maryam Tahhan <mtahhan@...hat.com>, xdp-hints@...-project.net,
        netdev@...r.kernel.org
Subject: Re: [xdp-hints] [PATCH bpf-next v3 00/11] xdp: hints via kfuncs

Stanislav Fomichev <sdf@...gle.com> writes:

> Please see the first patch in the series for the overall
> design and use-cases.
>
> Changes since v2:
>
> - Rework bpf_prog_aux->xdp_netdev refcnt (Martin)
>
>   Switched to dropping the count early, after loading / verification is
>   done. At attach time, the pointer value is used only for comparing
>   the actual netdev at attach vs netdev at load.

So if we're not holding the netdev reference, we'll end up with a BPF
program with hard-coded CALL instructions calling into a module that
could potentially be unloaded while that BPF program is still alive,
right?

I suppose that since we're checking that the attach iface is the same
that the program should not be able to run after the module is unloaded,
but it still seems a bit iffy. And we should definitely block
BPF_PROG_RUN invocations of programs with a netdev set (but we should do
that anyway).

>   (potentially can be a problem if the same slub slot is reused
>   for another netdev later on?)

Yeah, this would be bad as well, obviously. I guess this could happen?

-Toke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ