From patchwork Fri Apr 28 03:09:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 88439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp668310vqo; Thu, 27 Apr 2023 20:12:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6o2DbXo6fbtunQqRyx/zU/BL5Z0+6SumdkAMp9a93TLci5NrmwkkoeU12KGHA9rrBUq+la X-Received: by 2002:a17:90a:dc18:b0:247:e54:2ca4 with SMTP id i24-20020a17090adc1800b002470e542ca4mr4867895pjv.19.1682651548362; Thu, 27 Apr 2023 20:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682651548; cv=none; d=google.com; s=arc-20160816; b=i/K/x9CPWZBrOkdXxtDYOn9dHYUfUcksB/E0OdchlkhanzYrZQaUk7+RsWF4TRPu/a 7p+sD1S8alYUClDkwf+k7Bl7OyAZCDmBVK0VRQOVV0nhEsfPYTVviRGmFxNkO3VBYL9U PepWnBqdlIb3Br325SBDzGt4+asxSYxPIrkKPYILez2yMNYzh1Ap6EHq6KZ7c1hXyznG oPcmR14XeQjUB/jEl5luBUWE8AkMCbSfmsux8z50y8KHBCP9eC26/cuI1Zrju/X1SfRz xV1E7RlTQ/pU3WgJia6UXJN5NT6emZ/WMxAXnsEGfttOf2nHA7d0Px47Dl5bnmCfrBmM tnaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HPYgfypTw1vIYU6R0OqK5IQj1qxUl03tjuR1IIa/a8c=; b=aBs6ql8rZC+BZH4CShPj/v656wuRN1MrAMUVltxrClDmY8ZVzkU38oMZPDg4a0PlmB apxW8JHiZqZWD/2mKkO8z2q6YtfM525/c5nYjQrBFupVCMA/KKwlnJQ8jIiKSBYE15Az Y3ZbJaxWP5WVamnJdmFooguTOWuLbxyhBwLnNU8KWfWYcm3FOLa1jkLnatseucDiXivK FqmUGcUHzLx8ohL6cFun3HcvtefJaKUXpB2G3uhQqhhZrzqoGfDisrcdvt0J5rnLsi3k DqY1bYxgJ8MUgTLRQARzGO+d+ndLVXpJWvBYqjU2cB36mh5j+DSxpX9M4QzMHGLkD5B0 X4iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="j/v0+ju9"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mt5-20020a17090b230500b0024709ef2225si1157951pjb.84.2023.04.27.20.12.13; Thu, 27 Apr 2023 20:12:28 -0700 (PDT) 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=@infradead.org header.s=bombadil.20210309 header.b="j/v0+ju9"; 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 S1345281AbjD1DKw (ORCPT + 99 others); Thu, 27 Apr 2023 23:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345218AbjD1DKT (ORCPT ); Thu, 27 Apr 2023 23:10:19 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A427A30D2; Thu, 27 Apr 2023 20:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=HPYgfypTw1vIYU6R0OqK5IQj1qxUl03tjuR1IIa/a8c=; b=j/v0+ju9xbMPnDp2E4/bEYP8IT gyhT7SrJOmn5lNnQjR/Xx/G161RjDzXwX7wcW4qyxN7GYDlVppbqBvuYrkHuje0yYnUuRevKNLCwk 7O/Pq/qWplbwui5hkzJWZ07klRcQgWjqTAyt3E9N0CD9NgCaXM0XaMiBs+NFjbFEjM4SICSgyD48J z0rvQP01xtWEvrCe03kRJH6ZIvBXqrUWxMXTqd0R8G0b6TnMG0eRnuh9r7IoUt1ENLvYLTnqD+qV+ +lwSR0G9J0prR+hMb+DK8XiU23oIMM8GGM8R7QZ5qlfM7Nynw+zYwoPV/T2g/3MD1yIsGfneEDa7s q8NTHZ8g==; Received: from [2601:1c2:980:9ec0::2764] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1psEU1-0082Yk-34; Fri, 28 Apr 2023 03:09:18 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Paul Moore , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, KP Singh , bpf@vger.kernel.org Subject: [PATCH] lsm: move hook comments docs to security/security.c Date: Thu, 27 Apr 2023 20:09:16 -0700 Message-Id: <20230428030916.2966-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764388029846295981?= X-GMAIL-MSGID: =?utf-8?q?1764388029846295981?= Fix one kernel-doc warning, but invesigating that led to other kernel-doc movement (lsm_hooks.h to security.c) that needs to be fixed also. include/linux/lsm_hooks.h:1: warning: no structured comments found Fixes: e261301c851a ("lsm: move the remaining LSM hook comments to security/security.c") Fixes: 1cd2aca64a5d ("lsm: move the io_uring hook comments to security/security.c") Fixes: 452b670c7222 ("lsm: move the perf hook comments to security/security.c") Fixes: 55e853201a9e ("lsm: move the bpf hook comments to security/security.c") Fixes: b14faf9c94a6 ("lsm: move the audit hook comments to security/security.c") Fixes: 1427ddbe5cc1 ("lsm: move the binder hook comments to security/security.c") Fixes: 43fad2821876 ("lsm: move the sysv hook comments to security/security.c") Fixes: ecc419a44535 ("lsm: move the key hook comments to security/security.c") Fixes: 742b99456e86 ("lsm: move the xfrm hook comments to security/security.c") Fixes: ac318aed5498 ("lsm: move the Infiniband hook comments to security/security.c") Fixes: 4a49f592e931 ("lsm: move the SCTP hook comments to security/security.c") Fixes: 6b6bbe8c02a1 ("lsm: move the socket hook comments to security/security.c") Fixes: 2c2442fd46cd ("lsm: move the AF_UNIX hook comments to security/security.c") Fixes: 2bcf51bf2f03 ("lsm: move the netlink hook comments to security/security.c") Fixes: 130c53bfee4b ("lsm: move the task hook comments to security/security.c") Fixes: a0fd6480de48 ("lsm: move the file hook comments to security/security.c") Fixes: 9348944b775d ("lsm: move the kernfs hook comments to security/security.c") Fixes: 916e32584dfa ("lsm: move the inode hook comments to security/security.c") Fixes: 08526a902cc4 ("lsm: move the filesystem hook comments to security/security.c") Fixes: 36819f185590 ("lsm: move the fs_context hook comments to security/security.c") Fixes: 1661372c912d ("lsm: move the program execution hook comments to security/security.c") Signed-off-by: Randy Dunlap Cc: Paul Moore Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-security-module@vger.kernel.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: KP Singh Cc: bpf@vger.kernel.org Acked-by: Paul Moore --- Documentation/bpf/prog_lsm.rst | 2 +- Documentation/security/lsm-development.rst | 6 +++--- Documentation/security/lsm.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff -- a/Documentation/bpf/prog_lsm.rst b/Documentation/bpf/prog_lsm.rst --- a/Documentation/bpf/prog_lsm.rst +++ b/Documentation/bpf/prog_lsm.rst @@ -18,7 +18,7 @@ LSM hook: .. c:function:: int file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, unsigned long prot); Other LSM hooks which can be instrumented can be found in -``include/linux/lsm_hooks.h``. +``security/security.c``. eBPF programs that use Documentation/bpf/btf.rst do not need to include kernel headers for accessing information from the attached eBPF program's context. diff -- a/Documentation/security/lsm-development.rst b/Documentation/security/lsm-development.rst --- a/Documentation/security/lsm-development.rst +++ b/Documentation/security/lsm-development.rst @@ -11,7 +11,7 @@ that end users and distros can make a mo LSMs suit their requirements. For extensive documentation on the available LSM hook interfaces, please -see ``include/linux/lsm_hooks.h`` and associated structures: +see ``security/security.c`` and associated structures: -.. kernel-doc:: include/linux/lsm_hooks.h - :internal: +.. kernel-doc:: security/security.c + :export: diff -- a/Documentation/security/lsm.rst b/Documentation/security/lsm.rst --- a/Documentation/security/lsm.rst +++ b/Documentation/security/lsm.rst @@ -98,7 +98,7 @@ associate these values with real securit LSM hooks are maintained in lists. A list is maintained for each hook, and the hooks are called in the order specified by CONFIG_LSM. Detailed documentation for each hook is -included in the `include/linux/lsm_hooks.h` header file. +included in the `security/security.c` source file. The LSM framework provides for a close approximation of general security module stacking. It defines