Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1111006rwb; Wed, 16 Nov 2022 12:13:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5kmb2cFgbRetarV0Gh1ilCUscvRaKGFg8mIbj0XUcqmL1osjb5v9Stv9f2ujtPC65fc57L X-Received: by 2002:a63:2026:0:b0:46f:b2a5:6294 with SMTP id g38-20020a632026000000b0046fb2a56294mr22016826pgg.570.1668629606033; Wed, 16 Nov 2022 12:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668629606; cv=none; d=google.com; s=arc-20160816; b=eA94f14NCGuAJ0fH9Iwi79z2jKQjyIRuDRZpRW9vaHYz8aixaNsJFcSy4uYL3op78X L15j/q0bIGPCxgCLxxRSRyPyDPlU7P/Fh+VVAClR8XHINbKDEfm+x2B8GcdsC9hHPkZI iZ85A5vTt6rpuOBkFs4ZxNdceGaeNHYuaBTr8+GJFnohQsXd97Bdpjak+p/QDomzJgxW O1COKU75R4A/pZ7K93n8NsA0aAdhtj+ya6vlgW4fbqsxi5ZTj4tTnGoget3iHQiC7rwr jcCoZql3qeeVnu9MMZO/ETNWHtFdtof9U9lcIzbsj568P0UwEK7X+TVBLsGfy9g0RMsC bR5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RijC22/SdwWwg/bVfJzaGWhRZ22gyvsY9MCYb3HpSxY=; b=Qop7GQTom00y9Q+qI8s0IMnqe8i4x8WxzneEjkZDQPaHu9OyYAz71f0fIV+kmXWm71 bo5ljnxaOYcWKaOi28094zMsKsGPB1RKIkQTgVRDPBmZhNuHdKQgXiIEEB1UyGPvmxbq MQ7AUBp6/5R7ixmbuJ9TbSIepIFmHKFrwL36Exfj2PW2krquWs6yzu1IPg9KT8udMrVE DDEImRY8sm/EFqqfhSgN/4COnUMEQnm7K7cGmIj9Xq2udzTteCRdgPgZp47TXUUkZIfI kuFfOZ57ps3x4zzK4Spe44AP4TYehyJofTxNGyUHNAnUPlW702gk2S2/LGrfnGcGRJ/d La5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=WQddw7AQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b29-20020a631b5d000000b0046b2bef339csi15533026pgm.257.2022.11.16.12.13.11; Wed, 16 Nov 2022 12:13:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=WQddw7AQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234154AbiKPT0o (ORCPT + 90 others); Wed, 16 Nov 2022 14:26:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbiKPT0l (ORCPT ); Wed, 16 Nov 2022 14:26:41 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 962DE5802E for ; Wed, 16 Nov 2022 11:26:40 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so3384969pjl.3 for ; Wed, 16 Nov 2022 11:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RijC22/SdwWwg/bVfJzaGWhRZ22gyvsY9MCYb3HpSxY=; b=WQddw7AQUG58WBNwtzFfChA6jc5qW8cC0yityyraiaiSt71wJQ8GsDoEZOoBRmp3MZ Tr4YLCLhGsNc5wqaWjb5aC2QDWh87piwicrRRhdh1w7X76luhS02KBieKcG7DA9wLjYV RJCn/iGsRHkslnIFGtBC6En/Ibg/VOzx/fJk8opvWY7TBSTEnvszEcMzsu8nvprRIeKx ANOb9Uf3699OL/Jhrf06cezPYP4/YfF9EcyBAeZOslsDiRRD4uiBgoJsMiYohqNIMf8m qCP1Cg2XQFTecvrA/bqnWnWg3oaHrlc1aVM+wA76XwYw9gAxiL5+uswFoVbxZQzp42JR XWfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RijC22/SdwWwg/bVfJzaGWhRZ22gyvsY9MCYb3HpSxY=; b=Fbw/lugnzlhQAVRxAYwi3SITEO0v6W2fBQfrDjLliHcACCKMQa4a411rdkTA2HzaAA CV4z6ZhVVhO6whlFj7umfq/pksWsXJnj3HT2z3rvC2uejm4Mve8ZpFW4mqsz/E2w/i9t FByWynUTQfri2rJlK8hpunu/Es9CfjyaPKfzLXcGUnOHiRgnkuMutJ8PIO+FXxaMIkYD 5Cft3sGSJJzVm+/gQUlALCIM08fIeJX+n3kq5boBTf6OYKZRfJeDAIbfdlgm3me3LtvY UJVLJ8iGETLi9I5VdL4AzO0OBrdcDPc+eitJsIlHb2X82uQHpvZN9WentDTqJ/5DO75K 9bkg== X-Gm-Message-State: ANoB5plnryk94AtjoFnVjOIQVC8dnuhAQ/LQcfBa3kyP9gGRK3mB6EI1 RYsFcxyOS0gkbT/2caAKGKHPRvP41r9WdtsIf19E X-Received: by 2002:a17:902:be04:b0:17b:4ace:b67f with SMTP id r4-20020a170902be0400b0017b4aceb67fmr10827665pls.12.1668626800083; Wed, 16 Nov 2022 11:26:40 -0800 (PST) MIME-Version: 1.0 References: <20221115175652.3836811-1-roberto.sassu@huaweicloud.com> <20221115175652.3836811-3-roberto.sassu@huaweicloud.com> In-Reply-To: From: Paul Moore Date: Wed, 16 Nov 2022 14:26:29 -0500 Message-ID: Subject: Re: [RFC][PATCH 2/4] lsm: Add missing return values doc in lsm_hooks.h and fix formatting To: Roberto Sassu Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, revest@chromium.org, jackmanb@chromium.org, jmorris@namei.org, serge@hallyn.com, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Roberto Sassu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 16, 2022 at 3:07 AM Roberto Sassu wrote: > > On Tue, 2022-11-15 at 21:23 -0500, Paul Moore wrote: > > On Tue, Nov 15, 2022 at 12:57 PM Roberto Sassu > > wrote: > > > From: Roberto Sassu > > > > > > Ensure that for non-void LSM hooks there is a description of the return > > > values. Also replace spaces with tab for indentation, remove empty lines > > > between the hook description and the list of parameters and add the period > > > at the end of the parameter description. > > > > > > Finally, replace the description of the sb_parse_opts_str hook, which was > > > removed with commit 757cbe597fe8 ("LSM: new method: ->sb_add_mnt_opt()"), > > > with one for the new hook sb_add_mnt_opt. > > > > > > Signed-off-by: Roberto Sassu > > > --- > > > include/linux/lsm_hooks.h | 123 ++++++++++++++++++++++++++------------ > > > 1 file changed, 86 insertions(+), 37 deletions(-) > > > > ... > > > > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h > > > index f40b82ca91e7..c0c570b7eabd 100644 > > > --- a/include/linux/lsm_hooks.h > > > +++ b/include/linux/lsm_hooks.h > > > @@ -176,18 +183,22 @@ > > > * Set the security relevant mount options used for a superblock > > > * @sb the superblock to set security mount options for > > > * @opts binary data structure containing all lsm mount data > > > + * Return 0 on success, error on failure. > > > * @sb_clone_mnt_opts: > > > * Copy all security options from a given superblock to another > > > * @oldsb old superblock which contain information to clone > > > * @newsb new superblock which needs filled in > > > - * @sb_parse_opts_str: > > > - * Parse a string of security data filling in the opts structure > > > - * @options string containing all mount options known by the LSM > > > - * @opts binary data structure usable by the LSM > > > + * Return 0 on success, error on failure. > > > + * @add_mnt_opt: > > > + * Add a new mount option @option with value @val and length @len to the > > > + * existing mount options @mnt_opts. > > > + * Return 0 if the option was successfully added, a negative value > > > + * otherwise. > > > > I really appreciate the effort to improve the LSM hook comments/docs, > > but the "sb_add_mnt_opt" hook was removed in 52f982f00b22 > > ("security,selinux: remove security_add_mnt_opt()"). > > Right, sorry, didn't notice. No problem. I just wanted to make it clear that I really like this patch, and if you can fix the above and double-check the others I'll gladly merge this. As a general rule I *love* doc improvements :) -- paul-moore.com