Received: by 10.213.65.68 with SMTP id h4csp684113imn; Tue, 27 Mar 2018 06:59:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4eTVl7jHspCmZkrCbPaa/VYLZJy4Ccuf1UOp8kRZwnc9HJAkCLeAk0cx+VcigFCgUu3mm X-Received: by 2002:a17:902:bc45:: with SMTP id t5-v6mr2976693plz.343.1522159164928; Tue, 27 Mar 2018 06:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522159164; cv=none; d=google.com; s=arc-20160816; b=T6U6risN+1XqjFOlAAnHcwQMauwL8U1aY12IpSTxrd+xy7buqXWAU+74QWIy5Wp/dt bAm7unuqEQ0qV6FZ/isVSd4G+UJW/LjjDSwcdLOzHHXLxp+a2QDr2HFHwcHdGWr34pBg 1bkwaSzgTaHH1+IoV6SdWstmRmNJnFVzB91KCdGt48Fnm8aLd/7HF6zHgFnZms6/SY5R V3bSHyZoFBM7NoQ+MfV3EN1lQJZsK/F5vxPxQMvT5+kBYzJz5xGNf+fxr39gA5Is5pK0 qwKQazz+7en8AzwWOXPbBUuZjcrex6SvzWsNAgDER7WmXq6MXyht0UXZOnR0D5+EOdUK 3NnA== 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=085tvG9xsnJsxnlE2vyFteBRlkfucB3KdVIJNn4d5KI=; b=m5iOFHKyDMPqB9qJkkD02lmDVVy7qyAS0kilmXxeRoxOFRcX3P4Kr+FqfiOY801rVS qsn4OBpjfaS6oMNnVmzRYzu6TLvaX1x14W5ovCbXbaY/AFa1iAgze/icOHQwPmjHtWM+ Fm/QqttAkeLvBK1BRVodIaPRNRISFqwpIrbP2bJpMiYlgDtPJKd16lJCzMheS0FRYAFS shwJuigKcjKWTSqWzpnN7viEde29NwBwc/jQ/rXUXjo2IrM5SXtIsINnsg2a7GWHG+83 ac7tyTfVrkxZP63m8hb4Pg8nQGPxFGGmOijjrR5kwelbQPH7gJju+mRVn1kgGU7MoEoi ZkrQ== 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 q4si1019081pfi.317.2018.03.27.06.59.10; Tue, 27 Mar 2018 06:59:24 -0700 (PDT) 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 S1752802AbeC0N5b (ORCPT + 99 others); Tue, 27 Mar 2018 09:57:31 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44174 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbeC0N51 (ORCPT ); Tue, 27 Mar 2018 09:57:27 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2RDu0Mk017786 for ; Tue, 27 Mar 2018 09:57:27 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gyn2fqa78-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 27 Mar 2018 09:57:26 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Mar 2018 09:57:25 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Mar 2018 09:57:20 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2RDvKIT47185976; Tue, 27 Mar 2018 13:57:20 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEEFFB204D; Tue, 27 Mar 2018 10:59:29 -0400 (EDT) Received: from sbct-3.watson.ibm.com (unknown [9.47.158.153]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id DF12DB2046; Tue, 27 Mar 2018 10:59:29 -0400 (EDT) From: Stefan Berger To: linux-integrity@vger.kernel.org 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, James.Bottomley@HansenPartnership.com, zohar@linux.vnet.ibm.com, ebiederm@xmission.com, Stefan Berger Subject: [RFC PATCH v3 0/3] ima: namespacing IMA Date: Tue, 27 Mar 2018 09:57:15 -0400 X-Mailer: git-send-email 2.5.5 X-TM-AS-GCONF: 00 x-cbid: 18032713-0040-0000-0000-0000040D87CE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008753; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01009167; UDB=6.00514062; IPR=6.00788450; MB=3.00020268; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-27 13:57:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032713-0041-0000-0000-0000080E9478 Message-Id: <1522159038-14175-1-git-send-email-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-27_06:,, 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-1803270141 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 user namespace with CLONE_NEWUSER, 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. The previously posted version 2 of this series had it hooked on the mount namespace, which was regarded as inappropriate. Based on comments, we elected to hang the IMA namepace off of the existing user namespace now. In this patch series we are adding a pointer to the user_namespace pointing to the ima_namespace. Both are now tied together and joining the user_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. Stefan 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 include/linux/ima.h | 67 +++++++++ include/linux/user_namespace.h | 4 + init/Kconfig | 10 ++ kernel/user.c | 7 + kernel/user_namespace.c | 18 +++ 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 | 43 ++++++ security/integrity/ima/ima_main.c | 15 ++- security/integrity/ima/ima_ns.c | 225 +++++++++++++++++++++++++++++++ 12 files changed, 443 insertions(+), 8 deletions(-) create mode 100644 security/integrity/ima/ima_init_ima_ns.c create mode 100644 security/integrity/ima/ima_ns.c -- 2.14.3