Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1196967imu; Thu, 13 Dec 2018 10:56:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/XldsnU2QXQlufk/p4Fv9zAM0qQzbRDLWsPXXvYMGWHYidrm3Thm1/x9Ix1x1+HiK94Xo8w X-Received: by 2002:a63:a35c:: with SMTP id v28mr22747920pgn.205.1544727367882; Thu, 13 Dec 2018 10:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544727367; cv=none; d=google.com; s=arc-20160816; b=gcnk8e+0VQlVLI3xIbvLCieoP/+0f8f20pEzfgwdsU9m+LyQiZEfcv+iVUadZ8968z vJ6/ApnqC2VZZjmzrARaNSE3otOsup5Un8ERpzhKQ0ooDivyniZfKBlkEm40vuY5UUey YY0Uya9rx/E7wtFOY09cuN6gEJykrZlDYeeIg3TzNpRwX5UEJSxMBMwFr6lIGHoPlwGd sLG2iHfRTtewU85ftK4vCkHfS3P4Onml2t2jBg+vKh1EjzpBE81DO5LYpjEeKr8kP7A9 0u984Wm6iGa1KanIRIxRirpzyAnGs1jgoV5WfH4PR3CVtBIqrwMaCwP01CTAgc17Ks18 haxQ== 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=VPQ2gCGbuaAdu/8ydEJx3btbeBgiEKCQTGodXXCjAJE=; b=NlKyJCx/OFPXVFQNew1/7BNcQxQrPrVmw9m8XsNrMtuOlKkLXtxhb30eRkVAeyDif+ A4IO+AWvP2ZkJEAUAQx7oOCTmVZt/47fR8ZNjVZOOAZRm40d7xHijA3r3PP/ORy+pZhW TZyFHklWgjA3B7EyolXWTgZ8IFAloHhk94Vnn38AZB7a969kBgF93cJ/f+eQpyBGoEv9 7blVaOCVLMRVXZYDhCK43qRPhGYCleomElXWF+MF81MGm6Hz+EVaocatcKSulw7WeDx4 aKTuY0CDG1dvOaiV32iU/wZQZ6d244P4Z3F1wDCQc3uEJwqZlruI3Tq3D8odZitJ4wFe 39rw== 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 a26si2078553pgl.282.2018.12.13.10.55.52; Thu, 13 Dec 2018 10:56:07 -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 S1727604AbeLMSy6 (ORCPT + 99 others); Thu, 13 Dec 2018 13:54:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50936 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeLMSy5 (ORCPT ); Thu, 13 Dec 2018 13:54:57 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37A1E30833A4; Thu, 13 Dec 2018 18:54:57 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9E3C1992A; Thu, 13 Dec 2018 18:54:56 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 628C72208FC; Thu, 13 Dec 2018 13:54:56 -0500 (EST) Date: Thu, 13 Dec 2018 13:54:56 -0500 From: Vivek Goyal To: Stephen Smalley Cc: Miklos Szeredi , 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: <20181213185456.GC4384@redhat.com> References: <20181204154243.GA16818@redhat.com> <665ec6f3-f16d-681f-30d5-eface14c9808@tycho.nsa.gov> <20181204161747.GC16818@redhat.com> <20181205134317.GA11337@redhat.com> <8eb7f677-fd71-c31b-bfed-29fb7187d132@tycho.nsa.gov> <20181211214821.GD17242@redhat.com> <2e4d90ce-61e7-56b1-c161-4e5fb7236537@tycho.nsa.gov> <20181213145813.GB4384@redhat.com> <846eb23e-1188-9e45-ee0a-676d26cc715e@tycho.nsa.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <846eb23e-1188-9e45-ee0a-676d26cc715e@tycho.nsa.gov> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Dec 2018 18:54:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 13, 2018 at 11:12:31AM -0500, Stephen Smalley wrote: [..] > > > > Can you elaborate a bit more on how this is leaking data through overlay > > > > mount. If it is, then why accessing file on lower is not equivalent of > > > > leaking of data. > > > > > > In the container use case, retaining the lower label on copy-up for a > > > context-mounted overlay permits a process in the container to leak the > > > container data out to host files not labeled with the container label and > > > thus potentially accessible to other containers or host processes. > > > > > The > > > container process appears to just be writing to files labeled with the > > > container label via the overlay, but the written data and/or metadata is > > > directly accessible through the lower label, which is likely readable to > > > all/many containers and host processes. > > > > > > In the multi-level security (MLS) use case, an analogy would a situation > > > where you have an unclassified lower dir with some content to be shared > > > read-only across all levels, and an overlay is context-mounted at each level > > > with a corresponding upper dir and work dir private to that level. If a > > > client process at secret performs a write to a file via the secret overlay, > > > and if the written data is stored in a file in the upper dir that inherits > > > the label from the lower file (unclassified), then the secret process can > > > leak data to unclassified processes at will, violating the MLS policy. > > > > For the case of devices, its already happening. One might change metadata > > of a device (hence trigger copy up). Now all writes to upper device file > > from secret process still go to same underlying device and are still > > readable from lower device file. > > This is an argument for not copying up device files IMHO, not for preserving > the lower label on them. How do we handle metadata change to device node (like timestamp, ownership change) without copy up. Vivek