Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8392761imu; Tue, 4 Dec 2018 07:43:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/XV//KKRCHbY5k2HNHR6h3gcDXO6BYfJtaGQ/wKQw6h8Rlc2zroECUdWzZPEbVfxJ5Iw48r X-Received: by 2002:a62:fc86:: with SMTP id e128mr21410879pfh.54.1543938217558; Tue, 04 Dec 2018 07:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543938217; cv=none; d=google.com; s=arc-20160816; b=lwf+Oj9zWa64cpBqMShRDVxpk1+5qjW6sQCaCPFRHRFilGEagyBvJM70OI+DLUEEkM V/Y6olN69uhsVtVl+PH3ylj1TJwlkICjm+UdOXZBmrHJBe/ZjNHXdATkThVJYZMTvPPB WlDHHCoZD+SO4FUAQD13uGWtflEcSrUChr6nlP+jDNdCVGDdvhUUQaS9c0sF341LbYdq wF/itYH0i/G7Dsovg8hmXM6uGkRh3jRSOEWQ2BNaHHpZZKDUCmcSas4vcG1WK45FfjuR kh6TuFnaWz3XDiUT3EmAvU/zuzZYmmW7lGN1ncOvVb1I+UMIxcVmhnwAq2j5C4kqoYvd E9XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GoTmVNat7ElH57tyVatk9L5ote771kIMXqoxzHKHeWo=; b=xCKOKd78f53tgH1VeyVGkgoQsgBosxcjrCPJ3wuz1L9LXoQCpwZCeh0QmF3UzJcvqk eOWzCM7AG2XN2XcE5mqU4AaWyz5r9NrynHONr8ehHFQE0l10LO1t19jVMvz+pg075nIo exHPPZ+qDYbZWOQtCLN7GglaT1eIayqcPh/1cA0CZ+KgrIEc3yAdDhhHnGymqIux04Ui MVwXwV7+MoSGLU9J9wCRTnW+ETXVDHF9FuSo9y45szR4xyEHgJpqWgsen+0AB/VcNJ3j uBIzwREqsrpjFh0xq/q5ZcgF9e4M1r47JED6D5qxET63IT2rN4mCslY6yqocRwuQ6F/p NGTQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si18255385ply.421.2018.12.04.07.43.21; Tue, 04 Dec 2018 07:43:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbeLDPmo (ORCPT + 99 others); Tue, 4 Dec 2018 10:42:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39230 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeLDPmo (ORCPT ); Tue, 4 Dec 2018 10:42:44 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B2F73082A33; Tue, 4 Dec 2018 15:42:44 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 925BE18B85; Tue, 4 Dec 2018 15:42:43 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 2C49F2208FC; Tue, 4 Dec 2018 10:42:43 -0500 (EST) Date: Tue, 4 Dec 2018 10:42:43 -0500 From: Vivek Goyal To: Miklos Szeredi Cc: Stephen Smalley , 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 Subject: Re: overlayfs access checks on underlying layers Message-ID: <20181204154243.GA16818@redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 04 Dec 2018 15:42:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks Vivek