Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3245067imu; Sat, 24 Nov 2018 00:58:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wl0p5fZd/SJ2fDQjEFzlF7bJAWpvYS/xGbNuFajVGM0f6VcEy/v48f6QpVsR3XCddbDhzx X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr19448285pls.281.1543049918102; Sat, 24 Nov 2018 00:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543049918; cv=none; d=google.com; s=arc-20160816; b=GNC/1pt3m3IIJRxJbB/H/gu9KSHfCph6cyMWuuLb8+3Xh0JBA+5Cj/Tf9jU8OU4m+x xUUt0Mz2g9Sg5/+SwvpOtkVPl739iwykJ4E6ED4JixE4651ulhTJdIrcR7y54aeWHaXW BADXM2zC8XC5nt6xyRuPmZ4yYjl997taQbF1j+qOqMtb2ikSierND5KawlbKyWWe2KVW 1duUP19oRj/GVFX5BhwE4vn2ihgMvhHzewMQwq7KtaryuyUagfeY7NoJj1ZTM/NAmP6K Ajb498XCpCZfWE0pXLHtcNDQW5nGPTcVjy3fEM+L15Xeh9AWPJKOXw3Picl/mm+OXyvT 9p/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=sa+lR7ZgzzkySYWvI+bDfjWaBovWZDEHM7o03IW2COo=; b=t44x3QH4RbwGa+HBCFB013dGgx0TJF3OmMhrQydllWFn+1UHqiGX3QcQ8Fd1Q+ySmL 9ZPuQlCXEQ/n6+mJ9eAROdhPXe3T+sUopt4EDbAu4JhMcSDIxFkZ6+vFyHsp+MYZ2IVj 8BrFI+HZwK8MpZaX9eWp2T1Jnj0ZmrQcaZ+meCdiv6Uh5a8cpAmRuYhz6Ka7cPP6aEuL 3LG9X1CNSyN5wDrbev0FxJGlYLKycAvsT37NpRAh8TRU+EV6vuoPLi0Y9e/99M2m2I3n MhPQJYGvhkt1YSlTXZJzDu0RDXa57gxVIS/qStAhv5ky7IGhdBu3quQ3I8My9R/xejAW QQ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=N5x89Lif; 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 y1si4412080plt.356.2018.11.24.00.58.23; Sat, 24 Nov 2018 00:58:38 -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; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=N5x89Lif; 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 S1729378AbeKXMx4 (ORCPT + 99 others); Sat, 24 Nov 2018 07:53:56 -0500 Received: from sonic305-28.consmr.mail.ne1.yahoo.com ([66.163.185.154]:45128 "EHLO sonic305-28.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729348AbeKXMx4 (ORCPT ); Sat, 24 Nov 2018 07:53:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1543025239; bh=sa+lR7ZgzzkySYWvI+bDfjWaBovWZDEHM7o03IW2COo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=N5x89LifGBU+RB0hXJuB8PavmJ75yDa25OHlvoGU4vcaAeSu3cWKfGncbknxufREI9rYnHXPOGgv17eGiG31mmOK+xi9NNNZusvo2r3OPPwCvQm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XpGKd.dJsAxrhhRq_eHaRn3BpQ7ZGia9Qqj3F55n3cGvQnqMPRNey5QAk2P1NV9FZQPl JfZDIZWf0GthvEOULB2KMBtg2_PHi28UN_MlzhJx_6ZsE787SAnZP.6EzSGK11GqqHItfMojG6T1 3EGtUsja9VauMEpDnv01UBR1gcLqldxIr5w1HbvWByAqdEWVTJHTrzG6yl05yQ05ple6stwB0_iI Ust.napZCvUmBnXcRWmRJ2cSk2JbhyHFBW0UVRFh80SQyjmUOoXDfLE5qTqKau5vIYi2SxKYU8Iy Fo0YVucgXBX4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Sat, 24 Nov 2018 02:07:19 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([67.169.65.224]) by smtp428.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 90f505ce1fb503747a7ed7a030947d41; Sat, 24 Nov 2018 02:07:16 +0000 (UTC) Subject: Re: [RFC][PATCH] fs: set xattrs in initramfs from regular files To: Mimi Zohar , Roberto Sassu , viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, initramfs@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com, dmitry.kasatkin@huawei.com, takondra@cisco.com, kamensky@cisco.com, hpa@zytor.com, arnd@arndb.de, rob@landley.net, james.w.mcmechan@gmail.com References: <20181122154942.18262-1-roberto.sassu@huawei.com> <3d1bfbd7-7d45-4cf1-32d6-7f6985b42393@schaufler-ca.com> <1543001453.4298.23.camel@linux.ibm.com> From: Casey Schaufler Message-ID: <6d6f3a60-7c80-4107-6d9b-be3d53cefefc@schaufler-ca.com> Date: Fri, 23 Nov 2018 18:07:13 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1543001453.4298.23.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23/2018 11:30 AM, Mimi Zohar wrote: > On Fri, 2018-11-23 at 11:03 -0800, Casey Schaufler wrote: >> On 11/22/2018 7:49 AM, Roberto Sassu wrote: >>> Although rootfs (tmpfs) supports xattrs, they are not set due to the >>> limitation of the cpio format. A new format called 'newcx' was proposed to >>> overcome this limitation. >>> >>> However, it looks like that adding a new format is not simple: 15 kernel >>> patches; user space tools must support the new format; mistakes made in the >>> past should be avoided; it is unclear whether the kernel should switch from >>> cpio to tar. >>> >>> The aim of this patch is to provide the same functionality without >>> introducing a new format. The value of xattrs is placed in regular files >>> having the same file name as the files xattrs are added to, plus a >>> separator and the xattr name (.xattr-). >>> >>> Example: >>> >>> '/bin/cat.xattr-security.ima' is the name of a file containing the value of >>> the security.ima xattr to be added to /bin/cat. >>> >>> At kernel initialization time, the kernel iterates over the rootfs >>> filesystem, and if it encounters files with the '.xattr-' separator, it >>> reads the content and adds the xattr to the file without the suffix. >> No. >> >> Really, no. >> >> It would be incredibly easy to use this mechanism to break >> into systems. >>   >> >>> This proposal requires that LSMs and IMA allow the read and setxattr >>> operations. This should not be a concern since: files with xattr values >>> are not parsed by the kernel; user space processes are not yet executed. >>> >>> It would be possible to include all xattrs in the same file, but this >>> increases the risk of the kernel being compromised by parsing the content. >> The kernel mustn't do this. > Mustn't do what?  Store the xattr as separate detached files, > include all the xattrs in a single or per security/LSM xattr attribute > file(s), or either? Any and all of the above. The proposed behavior is a kludge around making the installation tools work correctly. Sure, it may be easier to change the kernel than to change the utilities. That's doesn't make it right. > > Mimi > >