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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQLiUZpCvP+XXvOFQYaByzxDOVk=ALzV5Z0N8FqMaOh03g@mail.gmail.com>
Date: Mon, 4 Sep 2023 13:58:22 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Daan De Meyer <daan.j.demeyer@...il.com>
Cc: bpf <bpf@...r.kernel.org>, Martin KaFai Lau <martin.lau@...ux.dev>, 
	Kernel Team <kernel-team@...a.com>, Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v3 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to
 allow writing unix sockaddr from bpf

On Thu, Aug 31, 2023 at 8:36 AM Daan De Meyer <daan.j.demeyer@...il.com> wrote:
>
> As prep for adding unix socket support to the cgroup sockaddr hooks,
> let's add a kfunc bpf_sock_addr_set_unix_addr() that allows modifying a sockaddr
> from bpf. While this is already possible for AF_INET and AF_INET6, we'll
> need this kfunc when we add unix socket support since modifying the
> address for those requires modifying both the address and the sockaddr
> length.
>
> Signed-off-by: Daan De Meyer <daan.j.demeyer@...il.com>
> ---
>  kernel/bpf/btf.c  |  1 +
>  net/core/filter.c | 32 +++++++++++++++++++++++++++++++-
>  2 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 249657c466dd..15c972f27574 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -7819,6 +7819,7 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
>  {
>         switch (prog_type) {
>         case BPF_PROG_TYPE_UNSPEC:
> +       case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
>                 return BTF_KFUNC_HOOK_COMMON;

hook_common means that they are shared by all prog types.
See btf_kfunc_id_set_contains().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ