From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95B47C46467 for ; Tue, 10 Jan 2023 19:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbjAJT5c (ORCPT ); Tue, 10 Jan 2023 14:57:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231381AbjAJT5Z (ORCPT ); Tue, 10 Jan 2023 14:57:25 -0500 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B21B03; Tue, 10 Jan 2023 11:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1673380641; bh=RQq5pu5NWub8ZqozppXi0p7iitw87/LUUigchFQmVxY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ZrJz3/ygqAAvdb+rxMPc57zL4/R+16kGs6Yc35HYlJ0tuzi1rkRMFnyQ5uMywQrLf S8OuIaIFSwdvjO/k6iA62+tpYgdcbCmAJvWs92mlTxjP0EDJAaVbaQodjA80712XwM g7io7vCkC4zHnh37ViW69A3D2PoOKfH+tKEvBiHHSxGdfJDR4JfXbInX1wwEebZXcl D6Xx396Oj98onEM41owiZi3PnID968DtwVGNob4uYk/5K5YfkPPjwtiZ1NtW5usybE tqJhBiI09kAl5mo1A6thynwyPqGrTxVfPvNcyZqJB6jDaBDtYEo1HHhN0TwkckSDcK Qz0uvGVBye8xQ== Received: from [172.16.0.101] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Ns1mx5bzrzg3s; Tue, 10 Jan 2023 14:57:21 -0500 (EST) Message-ID: <57e095f5-2cf8-3f9a-0765-86990b4c1873@efficios.com> Date: Tue, 10 Jan 2023 14:57:55 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: rseq(2) man page Content-Language: en-US To: Alejandro Colomar , linux-man@vger.kernel.org, Alejandro Colomar , linux-kernel , Peter Zijlstra , Boqun Feng , paulmck References: <095c479b-baed-9d11-08a1-e698f59763d9@efficios.com> <425ddf00-24a1-bf02-29f1-937ba1545020@gmail.com> <71b43f20-5d6d-f3f8-b3cd-786dfbc8d34d@gmail.com> <71e6728d-c2a8-e646-5c6c-2de8dfa982cc@gmail.com> <71ea2fa3-e593-e1ae-7abd-377bdf302d24@gmail.com> From: Mathieu Desnoyers In-Reply-To: <71ea2fa3-e593-e1ae-7abd-377bdf302d24@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-01-10 14:28, Alejandro Colomar wrote: > > > On 1/10/23 17:54, Mathieu Desnoyers wrote: > > > [...] > >>>> .BI "int syscall(SYS_rseq, struct rseq *_Nullable " rseq ", uint32_t >>>> " rseq_len \ >>> >>> What's the meaning for NULL?  Does it have a valid sentinel meaning, >>> or is it an invalid address?  If it's just interpreted as an invalid >>> address (for which from a user-space perspective a crash would be >>> legitimate), then I'd remove _Nullable. >> >> With the flags that are currently implemented (0 or >> RSEQ_FLAG_UNREGISTER), >> the rseq argument is not expected to be legitimately NULL (it would >> return >> -1, errno=EFAULT on registration, or -1, errno=EINVAL on unregister >> attempt). >> >> We may add new flags in the future which would not care about the rseq >> address >> (it could very well be null then). Do you recommend that we only add the >> _Nullable tag when this occurs ? > > Yes; since it's what the user can pass, it makes sense to be as > constrained as possible.  If it were some return that the user would > have to inspect, it would make sense to be cautious on the NULL side of > things an use _Nullable preventively, but for an input, non-null is > preferred for now. OK, updated. > > > [...] > >> >> Updated version based on your comments pushed into my repo, thanks! > > Cool! I'll have a look. Thanks! Once you find it to your liking, I plan to sent it as a patch against the man-pages project. Mathieu > > Cheers, > > Alex > >> >> Mathieu >> >> > -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com