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: <bdffefed-8945-e5ac-052d-0f0b49a30d39@linux.dev>
Date: Tue, 10 Oct 2023 13:07:54 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Kuniyuki Iwashima <kuniyu@...zon.com>, daan.j.demeyer@...il.com
Cc: bpf@...r.kernel.org, kernel-team@...a.com, netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next v9 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to
 allow writing unix sockaddr from bpf

On 10/10/23 10:00 AM, Kuniyuki Iwashima wrote:
>> +__bpf_kfunc int bpf_sock_addr_set_unix_addr(struct bpf_sock_addr_kern *sa_kern,
>> +					    const u8 *addr, u32 addrlen__sz)
> I'd rename addrlen__sz to sun_path_len or something else because the
> conventional addrlen for AF_UNIX contains offsetof(struct sockaddr_un,
> sun_path).

The "__sz" suffix is required by the verifier. It is the size of the preceding 
argument "addr". While at it, addrlen__sz should be just "addr__sz" (or 
sun_path__sz, depending on what name is decided here) for consistency with other 
kfunc.

I don't have strong preference on the argument name. However, if it is 
sun_path__sz, then the preceding argument should be renamed to "sun_path" also 
for consistency reason and then the kfunc should probably be renamed to 
bpf_sock_addr_set_sun_path.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ