From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 942AEC433EF for ; Wed, 15 Dec 2021 21:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbhLOVcO (ORCPT ); Wed, 15 Dec 2021 16:32:14 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41372 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbhLOVcN (ORCPT ); Wed, 15 Dec 2021 16:32:13 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFInuwh001394; Wed, 15 Dec 2021 21:31:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=UTo7VolJaLhvIigc/EXW5yCahlSwjMCsZkv+nnTWXp0=; b=En87zwCq3KIk895WAQCp9jE0yIQEJA7s7fK8rkgfsgB/juWCrrvvSAFLzwz6E0Th/r3V Oa/pZf/dBRx38/uXKuxvw63uW5s98gfeNj20BNiNO7nrJiLE3mpayqZM7F4a88EALIuH IPuzw30gU686FVLhq7fc5t/MjWLVt0+H99mB9kZZEP9KNox2OqN7e/ctW2UtsZTbI6QA guCcWRevWxiFH1mTjESSon3nXgyK+08nr8IdJj+xExajrTGa2Xp762vaNVcf/HU6Zc8D lOR0l/UAD9xEBvbiyRjAhGh8RXDZph/Wqn5blo8foVOH+QG5DATk5M1sTdLWao85cAYU lg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cyp04k1r6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Dec 2021 21:31:57 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BFKqE4j021595; Wed, 15 Dec 2021 21:31:57 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cyp04k1qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Dec 2021 21:31:57 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BFLC8Gu006067; Wed, 15 Dec 2021 21:31:55 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3cy7k38s18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Dec 2021 21:31:55 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BFLVqDT28705230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 21:31:52 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E012AA404D; Wed, 15 Dec 2021 21:31:51 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0EA9DA4053; Wed, 15 Dec 2021 21:31:49 +0000 (GMT) Received: from sig-9-65-74-182.ibm.com (unknown [9.65.74.182]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 15 Dec 2021 21:31:48 +0000 (GMT) Message-ID: <11e9dbc416438575fe925c820ff7ad2d8d4b0510.camel@linux.ibm.com> Subject: Re: [PATCH v6 17/17] ima: Setup securityfs for IMA namespace From: Mimi Zohar To: Stefan Berger , linux-integrity@vger.kernel.org Cc: serge@hallyn.com, christian.brauner@ubuntu.com, containers@lists.linux.dev, dmitry.kasatkin@gmail.com, ebiederm@xmission.com, krzysztof.struczynski@huawei.com, roberto.sassu@huawei.com, mpeters@redhat.com, lhinds@redhat.com, lsturman@redhat.com, puiterwi@redhat.com, jejb@linux.ibm.com, jamjoom@us.ibm.com, linux-kernel@vger.kernel.org, paul@paul-moore.com, rgb@redhat.com, linux-security-module@vger.kernel.org, jmorris@namei.org, James Bottomley Date: Wed, 15 Dec 2021 16:31:48 -0500 In-Reply-To: <20211210194736.1538863-18-stefanb@linux.ibm.com> References: <20211210194736.1538863-1-stefanb@linux.ibm.com> <20211210194736.1538863-18-stefanb@linux.ibm.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: SQKIwUUyePw3cAE099hm-sHSXW1fdQ3n X-Proofpoint-ORIG-GUID: PQHljOI-iiFX6H2oGfl_ii_bdyo7clvM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-15_12,2021-12-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150116 Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Hi Stefan, James, On Fri, 2021-12-10 at 14:47 -0500, Stefan Berger wrote: > Setup securityfs with symlinks, directories, and files for IMA > namespacing support. The same directory structure that IMA uses on the > host is also created for the namespacing case. > > The securityfs file and directory ownerships cannot be set when the > IMA namespace is initialized. Therefore, delay the setup of the file > system to a later point when securityfs is in securityfs_fill_super. > > This filesystem can now be mounted as follows: > > mount -t securityfs /sys/kernel/security/ /sys/kernel/security/ > > The following directories, symlinks, and files are then available. > > $ ls -l sys/kernel/security/ > total 0 > lr--r--r--. 1 root root 0 Dec 2 00:18 ima -> integrity/ima > drwxr-xr-x. 3 root root 0 Dec 2 00:18 integrity The ima symlink was introduced for backwards compatibilty. Refer to commit 0c343af8065b ("integrity: Add an integrity directory in securityfs"). The symlink shouldn't need to be supported in IMA namespace. thanks, Mimi > > $ ls -l sys/kernel/security/ima/ > total 0 > -r--r-----. 1 root root 0 Dec 2 00:18 ascii_runtime_measurements > -r--r-----. 1 root root 0 Dec 2 00:18 binary_runtime_measurements > -rw-------. 1 root root 0 Dec 2 00:18 policy > -r--r-----. 1 root root 0 Dec 2 00:18 runtime_measurements_count > -r--r-----. 1 root root 0 Dec 2 00:18 violations > > Signed-off-by: Stefan Berger > Signed-off-by: James Bottomley