From patchwork Thu Jun 22 18:59:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 9805131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F36D60386 for ; Thu, 22 Jun 2017 19:00:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E81A28722 for ; Thu, 22 Jun 2017 19:00:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EEC928726; Thu, 22 Jun 2017 19:00:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09C5428722 for ; Thu, 22 Jun 2017 19:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808AbdFVTAV (ORCPT ); Thu, 22 Jun 2017 15:00:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49657 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752743AbdFVTAH (ORCPT ); Thu, 22 Jun 2017 15:00:07 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v5MIwunu087138 for ; Thu, 22 Jun 2017 15:00:06 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2b8jkkjdrh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Jun 2017 15:00:06 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Jun 2017 15:00:05 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 22 Jun 2017 15:00:00 -0400 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v5MJ00tE62718174; Thu, 22 Jun 2017 19:00:00 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D18062803E; Thu, 22 Jun 2017 14:59:53 -0400 (EDT) Received: from sbct-3.watson.ibm.com (unknown [9.2.141.158]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id 917812803A; Thu, 22 Jun 2017 14:59:53 -0400 (EDT) From: Stefan Berger To: ebiederm@xmission.com, containers@lists.linux-foundation.org Cc: lkp@01.org, xiaolong.ye@intel.com, linux-kernel@vger.kernel.org, zohar@linux.vnet.ibm.com, serge@hallyn.com, tycho@docker.com, James.Bottomley@HansenPartnership.com, christian.brauner@mailbox.org, stefanb@linux.vnet.ibm.com, vgoyal@redhat.com, amir73il@gmail.com, linux-security-module@vger.kernel.org Subject: [PATCH 3/3] Enable security.selinux in user namespaces Date: Thu, 22 Jun 2017 14:59:49 -0400 X-Mailer: git-send-email 2.5.5 In-Reply-To: <1498157989-11814-1-git-send-email-stefanb@linux.vnet.ibm.com> References: <1498157989-11814-1-git-send-email-stefanb@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17062219-2213-0000-0000-000001E5A6F4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007273; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00878407; UDB=6.00437683; IPR=6.00658543; BA=6.00005437; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015926; XFM=3.00000015; UTC=2017-06-22 19:00:03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17062219-2214-0000-0000-0000569B9B24 Message-Id: <1498157989-11814-4-git-send-email-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-22_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706220324 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Before the current modifications, SELinux extended attributes were visible inside the user namespace but changes in patch 1 hid them. This patch enables security.selinux in user namespaces and allows them to be written to in the same way as security.capability. Signed-off-by: Stefan Berger --- fs/xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/xattr.c b/fs/xattr.c index 045be85..37686ee 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -138,6 +138,7 @@ xattr_permission(struct inode *inode, const char *name, int mask) */ static const char *const userns_xattrs[] = { XATTR_NAME_CAPS, + XATTR_NAME_SELINUX, NULL };