Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8417401imu; Tue, 4 Dec 2018 08:05:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/UY5nas3QbVtI720Dh3auYpp2DV0agRnxmOMep6fzTtpZCO++uT+j8HjQBsaUgeKNaqhkSf X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr21028183plp.180.1543939546829; Tue, 04 Dec 2018 08:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543939546; cv=none; d=google.com; s=arc-20160816; b=pAq67SmAZlPhXq6PnU5nBecIpRGZfUk8Yq9FbPlrvUfnTeVn1f+zkQAqq0XqeBx1Wz ef++726VWCcisHxVCYt+R+jsdKN+EifSIOsUQnG726SyvX3wzfO+uXKYrQRRCAUZqUDq sAh3nOHOu706XA6BS9lsvWfSfSq1XK49ex4VdWci8wOZ18Au/YhsM0E6A9eKGdRMqJ47 WJ9uryraTe3mbTuZViBFXhNEPB1LzZ4UBcvaZRt3SjKqlprU3SWh55Jm7Q6onoU+vHsP lDah5GIyISqZW7TSY5xxqgJik4IyZiCETsiR4udyJ77IYV7Z3GVTJIw14N1fERrXatUn jlaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-phdr; bh=t/8s3hWo848KJ2LmTb9RowsCgLGrU0y1QUWqzBL+5z4=; b=ye7xdvP8XM7HKwYlhVtm71izVVJD6hycgKF+1EQuXeYjvCd/BuXzi7K8Ct8GgodESU 5TUsUr8j92Q+ImYBRjFm3il/v4vDtJ+IdtB+BcoTRdAr9C5axaTWTPxlvFxXudBfjWmA bjLmYQxe8yR0yY/ALfuHX/8JsyEMSK+wQNWme0Fl0OZL5HZG6lvELpkI6faH2og88Rwm x+c2aI7qhK4R4EnN/g6xnnrnj7cdFoqNvjICYWOB+AvOuRT57q2BsliGTa3U9bYkZz1w C5HHF08c0k3AbJI4cXGoPHuReNClHbG4xzL/2J7SIegWB67DfGlRV+YP2aBtNUlFHDbI 0bkQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si16713660pgp.135.2018.12.04.08.05.14; Tue, 04 Dec 2018 08:05:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbeLDQDy (ORCPT + 99 others); Tue, 4 Dec 2018 11:03:54 -0500 Received: from ucol19pa09.eemsg.mail.mil ([214.24.24.82]:19877 "EHLO ucol19pa09.eemsg.mail.mil" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeLDQDy (ORCPT ); Tue, 4 Dec 2018 11:03:54 -0500 X-EEMSG-check-008: 799520026|UCOL19PA09_EEMSG_MP7.csd.disa.mil X-IronPort-AV: E=Sophos;i="5.56,314,1539648000"; d="scan'208";a="799520026" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by ucol19pa09.eemsg.mail.mil with ESMTP/TLS/DHE-RSA-AES256-SHA256; 04 Dec 2018 16:03:32 +0000 X-IronPort-AV: E=Sophos;i="5.56,314,1539648000"; d="scan'208";a="18405045" IronPort-PHdr: =?us-ascii?q?9a23=3AfsjxNh8f7Yv0e/9uRHKM819IXTAuvvDOBiVQ1K?= =?us-ascii?q?B+1+sQIJqq85mqBkHD//Il1AaPAd2Lraocw8Pt8InYEVQa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3mxZEAlsqE0xOHWjG0t1KotsT6iMgQfj0JNnauwijjQohKb+?= =?us-ascii?q?t9ephdWjTmGNG+2tgr382lYHVf7lP2QgpcgMI=3D?= X-IPAS-Result: =?us-ascii?q?A2APAAAapQZc/wHyM5BkGQEBAQEBAQEBAQEBAQcBAQEBA?= =?us-ascii?q?QGBVAEBAQEBAQsBgVopgWgng3mUcwEBAQEBAQaBCC2JH5AkOAGEQAKDGyI3B?= =?us-ascii?q?g0BAwEBAQEBAQIBbCiCNiQBgmIBBSMVNAoDEAsOCgICJgICVwYBDAYCAQGCX?= =?us-ascii?q?j+BdQ2lBoEvhUCEcIELixMXeIEHgTiCa4gFglcCiyCEWDeQGgmROwYYgVuIN?= =?us-ascii?q?ocViQaRTSKBVSsIAhgIIQ+DJ4InF447IQMwgQUBAYpiAQE?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 04 Dec 2018 16:03:09 +0000 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id wB4G34Cr032116; Tue, 4 Dec 2018 11:03:04 -0500 Subject: Re: overlayfs access checks on underlying layers To: Vivek Goyal , Miklos Szeredi Cc: Ondrej Mosnacek , "J. Bruce Fields" , Mark Salyzyn , Paul Moore , linux-kernel@vger.kernel.org, overlayfs , linux-fsdevel@vger.kernel.org, selinux@vger.kernel.org, Daniel J Walsh References: <6b125e8e-413f-f8e6-c7ae-50f7235c8960@tycho.nsa.gov> <4c20a261-5ce1-f0a2-8d40-c6032a023216@tycho.nsa.gov> <20181204151549.GA21509@redhat.com> <20181204152248.GB21509@redhat.com> <20181204154243.GA16818@redhat.com> From: Stephen Smalley Message-ID: <665ec6f3-f16d-681f-30d5-eface14c9808@tycho.nsa.gov> Date: Tue, 4 Dec 2018 11:05:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181204154243.GA16818@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/4/18 10:42 AM, Vivek Goyal wrote: > On Tue, Dec 04, 2018 at 04:31:09PM +0100, Miklos Szeredi wrote: >> On Tue, Dec 4, 2018 at 4:22 PM Vivek Goyal wrote: >> >>> Having said that, this still create little anomaly when mknod to client >>> is not allowed on context label. So a device file, which is on lower >>> and client can not open it for read/write on host, it can now be opened >>> for read/write because mounter will allow access. So why it is different >>> that regular copy up. Well, in regular copy up, we created a copy of >>> the original object and allowed writing to that object (cp --preserve=all) >>> model. But in case of device file, writes will go to same original >>> object. (And not a separate copy). >> >> That's true. >> >> In that sense copy up of special file should result in upper having >> the same label as of lower, right? > > I guess that might be reasonable (if this behavior is a concern). So even > after copy up, client will not be able to read/write a device if it was > not allowed on lower. > > Stephen, what do you think about retaining label of lower for device > files during copy up. What about socket/fifo. We don't check client task access to the upper inode label, only to the overlay, right? So the client is still free to access the device through the overlay even if we preserve the lower inode label on the upper inode? What do we gain?