Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp307873imj; Thu, 7 Feb 2019 04:46:56 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibecycy3pkGx0EM6jhJ+z714/UoE5nETYNSE2SeH6YzAtS5D9t0MW3ED89KUdZLfF/ko0Vh X-Received: by 2002:a17:902:8a:: with SMTP id a10mr16568836pla.158.1549543616483; Thu, 07 Feb 2019 04:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549543616; cv=none; d=google.com; s=arc-20160816; b=Zfhc6ly/ny6kSon1PcRAoJFNbb39NLC4T2V5M07k1pmu4zEQdcf37vhXQ83gpVAeg+ SP+Nc/XRbO58R4iiNP/TrrRa+U380ofPNI+UhOn6SZsLgcM3f6lDU7K/GCw4AtvzFE7L VECcYguwIf8DKnLxwMhRaPnYxXYH45ZMC7Yx+Tym6zdmCCuybs640LWqjU1HCqFsBZvm BmVcAm2EBCgd61Ujtz5MmiG6uM7hOfWWkw7RDzt5Nl75SnguXePF7E9vQ21wzFBqXCu6 zEBGuW3K7SZDszdcl+JXQmx7LLQ8OzojUVxkqh2O5OXZS26TzqXZl3jtE5l/6GmloLDJ pu4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=jgQ0ldv5r1eaH1vU+Hda1cziltXC8Za8oiGi7Vc63S8=; b=Y9NsPoEeOYcUv7h6CLSuWchwdI7gAhrpGc+Lm8xf3GwKq4KDPSXZU+obLCZnL3Rbb9 mZQohpwpfe5PZZu5r5HkjA6Lq6wsNhqV+aWv8Qnt9uP0xAyLsRu0WeDtGdvYoN67ODnj mD4f64u1iVnR+DwJ0iLPTxRhbw8Io3c7Kn0366x/9L2qwbDAh15bpztCifFHIrne1LaO MrNqwD0L2frkS9z3MJUGBnCkIXHXa5+bEwukJWIMmIBfOnHedX1hEl2Gt+vLSpfOuwMx cmXUHGDGp8onW5wdwvnKP7Mmoftpp0o7TcFOJtQXNJCENYa2TYm9Gdi8q4EvbJ5h/DLZ QKuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si2006926pgl.398.2019.02.07.04.46.40; Thu, 07 Feb 2019 04:46:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbfBGMpy (ORCPT + 99 others); Thu, 7 Feb 2019 07:45:54 -0500 Received: from mail.ispras.ru ([83.149.199.45]:60792 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727321AbfBGMpt (ORCPT ); Thu, 7 Feb 2019 07:45:49 -0500 Received: from green.intra.ispras.ru (pluton2.ispras.ru [83.149.199.44]) by mail.ispras.ru (Postfix) with ESMTPSA id 6824E5400B6; Thu, 7 Feb 2019 15:45:47 +0300 (MSK) From: Denis Efremov To: "Eric W. Biederman" Cc: Denis Efremov , Casey Schaufler , Eric Paris , Kees Cook , John Johansen , James Morris , "Serge E. Hallyn" , Paul Moore , Kentaro Takeda , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/10] security: fix documentation for the shm_* hooks Date: Thu, 7 Feb 2019 15:44:58 +0300 Message-Id: <26eeda9e281a7650f028e554e2f64a25f17cb1d1.1549540487.git.efremov@ispras.ru> X-Mailer: git-send-email 2.17.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The shm_* hooks were changed in the commit "shm/security: Pass kern_ipc_perm not shmid_kernel into the shm security hooks" (7191adff2a55). The type of the argument shp was changed from shmid_kernel to kern_ipc_perm. This patch updates the documentation for the hooks accordingly. Signed-off-by: Denis Efremov --- include/linux/lsm_hooks.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 4bfb6532cbb3..8382dd1bed59 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -1137,34 +1137,34 @@ * Security hooks for System V Shared Memory Segments * * @shm_alloc_security: - * Allocate and attach a security structure to the shp->shm_perm.security - * field. The security field is initialized to NULL when the structure is + * Allocate and attach a security structure to the perm->security + * field. The security field is initialized to NULL when the structure is * first created. - * @shp contains the shared memory structure to be modified. + * @perm contains the IPC permissions of the shared memory structure. * Return 0 if operation was successful and permission is granted. * @shm_free_security: * Deallocate the security struct for this memory segment. - * @shp contains the shared memory structure to be modified. + * @perm contains the IPC permissions of the shared memory structure. * @shm_associate: * Check permission when a shared memory region is requested through the - * shmget system call. This hook is only called when returning the shared + * shmget system call. This hook is only called when returning the shared * memory region identifier for an existing region, not when a new shared * memory region is created. - * @shp contains the shared memory structure to be modified. + * @perm contains the IPC permissions of the shared memory structure. * @shmflg contains the operation control flags. * Return 0 if permission is granted. * @shm_shmctl: * Check permission when a shared memory control operation specified by - * @cmd is to be performed on the shared memory region @shp. - * The @shp may be NULL, e.g. for IPC_INFO or SHM_INFO. - * @shp contains shared memory structure to be modified. + * @cmd is to be performed on the shared memory region with permissions @perm. + * The @perm may be NULL, e.g. for IPC_INFO or SHM_INFO. + * @perm contains the IPC permissions of the shared memory structure. * @cmd contains the operation to be performed. * Return 0 if permission is granted. * @shm_shmat: * Check permissions prior to allowing the shmat system call to attach the - * shared memory segment @shp to the data segment of the calling process. - * The attaching address is specified by @shmaddr. - * @shp contains the shared memory structure to be modified. + * shared memory segment with permissions @perm to the data segment of the + * calling process. The attaching address is specified by @shmaddr. + * @perm contains the IPC permissions of the shared memory structure. * @shmaddr contains the address to attach memory region to. * @shmflg contains the operational flags. * Return 0 if permission is granted. @@ -1625,11 +1625,11 @@ union security_list_options { struct task_struct *target, long type, int mode); - int (*shm_alloc_security)(struct kern_ipc_perm *shp); - void (*shm_free_security)(struct kern_ipc_perm *shp); - int (*shm_associate)(struct kern_ipc_perm *shp, int shmflg); - int (*shm_shmctl)(struct kern_ipc_perm *shp, int cmd); - int (*shm_shmat)(struct kern_ipc_perm *shp, char __user *shmaddr, + int (*shm_alloc_security)(struct kern_ipc_perm *perm); + void (*shm_free_security)(struct kern_ipc_perm *perm); + int (*shm_associate)(struct kern_ipc_perm *perm, int shmflg); + int (*shm_shmctl)(struct kern_ipc_perm *perm, int cmd); + int (*shm_shmat)(struct kern_ipc_perm *perm, char __user *shmaddr, int shmflg); int (*sem_alloc_security)(struct kern_ipc_perm *perm); -- 2.17.2