From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8563321A0 for ; Tue, 10 Oct 2023 20:08:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VT+qGZV0" Received: from out-208.mta1.migadu.com (out-208.mta1.migadu.com [IPv6:2001:41d0:203:375::d0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86661B3 for ; Tue, 10 Oct 2023 13:08:02 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696968480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=48GnxUJ3JdEqliNp9G7adxZBHIHNpZhS/fW1boEK60M=; b=VT+qGZV0FDeNh7qu7r7D/avhtOK5+1/SxhoJIIr4bJDxTIghGa6L+Vb+9nt5KQyil3UU71 JYBA09jpgfXTOIdj0T5BdQq+Jy7N1u5IWZ6WpRFWjHkBC5/J8x2GyQrF8jkyGZPosbrXaw NlVMVOadPNDvwy1g3Ri/J7J0lETTe+Q= Date: Tue, 10 Oct 2023 13:07:54 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v9 3/9] bpf: Add bpf_sock_addr_set_unix_addr() to allow writing unix sockaddr from bpf Content-Language: en-US To: Kuniyuki Iwashima , daan.j.demeyer@gmail.com Cc: bpf@vger.kernel.org, kernel-team@meta.com, netdev@vger.kernel.org References: <20231006074530.892825-4-daan.j.demeyer@gmail.com> <20231010170019.4924-1-kuniyu@amazon.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20231010170019.4924-1-kuniyu@amazon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.