Received: by 10.223.185.111 with SMTP id b44csp714572wrg; Fri, 9 Mar 2018 12:17:47 -0800 (PST) X-Google-Smtp-Source: AG47ELtupNkRpMVYqt7XzgVxWoLwpAYAWMlueFQRk498EDyGfVUS8d4QDrHTt8Ve1eDi+I/YHRHU X-Received: by 10.101.101.10 with SMTP id x10mr25694620pgv.223.1520626667356; Fri, 09 Mar 2018 12:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520626667; cv=none; d=google.com; s=arc-20160816; b=EHh80hJi9omI2HbnKKnD/GsH58S7363Yc19MXNN/b8sRzRjEvHOBPx9ZiM2vBgv42z RuMIoXNPIOw6gKvBKcqsy2LiXMU73Bi/M/JFMhSa7RV6tSTOGr2STJXnrQRWwZ7eWtwS 9z0Eo3Tza85yQIx7MW2Orb+qDmO/aFoMm79BA2zC5vu+sSdbhUDi/txm/EJ/Woa5UwWm NB3zQghYluUije5V+U5LMBN39DsI+9kcR406k+qRtGJSE/iCyGH+5OfILO10AY9OZ65i FSwVk8dxpJpLJ7Ih95HY0bfIuXCf5S03yRSvlxwC5opke3oviOaNua21qmaRgnDjx4Pn zEzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=b31mqtBcxkXYk2WvRLcoiLouU4e/E4rBFe68PIYzfb4=; b=oSn1gJk92YbytuWSkwXDbbkjfuGQ2WncxNw1JAImKBTYchRRcBTwcfLMu9FLZucY8G 77BfE9Agx4MJIV18PZiT0df/vMJpH/5h3eZGH4fXxwZnUIL9vMLCLcsrHqNQmp4x3FxR chrYpYKhYq7I1bjQQ5OJJzyJ6rY+wA+fTbLHfOBROW9zF4rND2wx9pPc1HvSkpI/LsuM ZbjtG+IZScaFImIm4FNl7mwUhSWIPCVF01kBl+ulzCNiWOW3dV4XLssHh7W14XXBNWBf IJqRKzNO7u3WWj2Pk1C14u0Zxjg+5TjZNmV6dj2gT7jOKz2vInxRyOMq/icyG2rccbID hjVg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc11-v6si1386776plb.43.2018.03.09.12.17.33; Fri, 09 Mar 2018 12:17:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932327AbeCIUOl (ORCPT + 99 others); Fri, 9 Mar 2018 15:14:41 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35494 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbeCIUOj (ORCPT ); Fri, 9 Mar 2018 15:14:39 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29KEbIB132158 for ; Fri, 9 Mar 2018 15:14:39 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gky5wv6m1-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 15:14:38 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 15:14:37 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 15:14:35 -0500 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29KEYN841156658; Fri, 9 Mar 2018 20:14:34 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA0CD112040; Fri, 9 Mar 2018 15:13:04 -0500 (EST) Received: from localhost.localdomain (unknown [9.47.158.154]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id C2E10112054; Fri, 9 Mar 2018 15:13:04 -0500 (EST) From: Stefan Berger To: linux-ima-devel@lists.sourceforge.net Cc: containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, tycho@docker.com, serge@hallyn.com, sunyuqiong1988@gmail.com, david.safford@ge.com, mkayaalp@cs.binghamton.edu, linux-integrity@vger.kernel.org, James.Bottomley@HansenPartnership.com, zohar@linux.vnet.ibm.com, Stefan Berger Subject: [RFC PATCH v2 0/3] ima: namespacing IMA Date: Fri, 9 Mar 2018 15:14:18 -0500 X-Mailer: git-send-email 2.13.6 X-TM-AS-GCONF: 00 x-cbid: 18030920-0036-0000-0000-000002CDE6DE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008642; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01000666; UDB=6.00509011; IPR=6.00779996; MB=3.00019944; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-09 20:14:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030920-0037-0000-0000-00004397A16E Message-Id: <20180309201421.6150-1-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-09_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803090239 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set implements an IMA namespace data structure that gets created alongside a mount namespace with CLONE_NEWNS, and lays down the foundation for namespacing the different aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal). The original PoC patches [1] created a new CLONE_NEWIMA flag to explicitly control when a new IMA namespace should be created. Based on comments, we elected to hang the IMA namepace off of existing namespaces, and the mount namespace made the most sense. In this version of the patches we are adding a pointer to the mnt_namespace pointing to the ima_namespace. Both are now tied together and joining the mnt_namespace with setns() also joins the ima_namespace that was created along with it. The first patch creates the ima_namespace data, while the second patch puts the iint->flags in the namespace. The third patch uses these flags for namespacing the IMA-audit messages, enabling the same file to be audited each time it is accessed in a new namespace. Mehmet Kayaalp (2): ima: Add ns_status for storing namespaced iint data ima: mamespace audit status flags Yuqiong Sun (1): ima: extend clone() with IMA namespace support fs/mount.h | 14 -- fs/namespace.c | 29 +++- include/linux/ima.h | 70 ++++++++++ include/linux/mount.h | 20 ++- init/Kconfig | 10 ++ kernel/nsproxy.c | 1 + security/integrity/ima/Makefile | 3 +- security/integrity/ima/ima.h | 47 ++++++- security/integrity/ima/ima_api.c | 8 +- security/integrity/ima/ima_init.c | 4 + security/integrity/ima/ima_init_ima_ns.c | 44 ++++++ security/integrity/ima/ima_main.c | 15 +- security/integrity/ima/ima_ns.c | 230 +++++++++++++++++++++++++++++++ 13 files changed, 469 insertions(+), 26 deletions(-) create mode 100644 security/integrity/ima/ima_init_ima_ns.c create mode 100644 security/integrity/ima/ima_ns.c -- 2.13.6