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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Jan 2020 15:03:31 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     Alexei Starovoitov <ast@...nel.org>, davem@...emloft.net,
        daniel@...earbox.net, netdev@...r.kernel.org, bpf@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH bpf-next 3/6] bpf: Introduce function-by-function
 verification

On Thu, Jan 09, 2020 at 09:57:50AM +0100, Toke Høiland-Jørgensen wrote:
> 
> > As far as future plans when libbpf sees FUNC_EXTERN it will do the linking the
> > way we discussed in the other thread. The kernel will support FUNC_EXTERN when
> > we introduce dynamic libraries. A collection of bpf functions will be loaded
> > into the kernel first (like libc.so) and later programs will have FUNC_EXTERN
> > as part of their BTF to be resolved while loading. The func name to btf_id
> > resolution will be done by libbpf. The kernel verifier will do the type
> > checking on BTFs.
> 
> Right, FUNC_EXTERN will be rejected by the kernel unless it's patched up
> with "target" btf_ids by libbpf before load? So it'll be
> FUNC_GLOBAL-linked functions that will be replaceable after the fact
> with the "dynamic re-linking" feature?

Right. When libbpf statically links two .o it will need to produce a combined
BTF out of these two .o. That new BTF will not have FUNC_EXTERN anymore if they
are resolved. When the kernel sees FUNC_EXTERN it's a directive for the kernel
to resolve it. BPF program with FUNC_EXTERN references would be loadable, but
not executable. Anyhow the extern work is not immediate. I don't think any of
that is necessary for dynamic re-linking.

Powered by blists - more mailing lists