Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7274004imu; Wed, 14 Nov 2018 14:39:33 -0800 (PST) X-Google-Smtp-Source: AJdET5cjQz2o7GjRxIwO/FW1rgEg9h42LH1UmFoe63XUWw/fuxcEX2nwPEMtmBm6nzuxzPX2p7YU X-Received: by 2002:a62:6408:: with SMTP id y8mr3812971pfb.202.1542235173062; Wed, 14 Nov 2018 14:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542235173; cv=none; d=google.com; s=arc-20160816; b=iYkm6DJOi+M9wDgQYskDN98LOjf4KL/ENDTzkcWyzJcViG07Xrb51DVP5/7ZH7zPfl mccR2KL6bc9f/ywT0M7gtpJahMCIF96vOgUFbK7J134Ey8p/g6NjkyjTQqcR8g0Gfu4D m0rvt+d1uxnwthuxh4mAq08m6JyCbOJ+u8DbNqdYCG1lGLpe/I0wtGRfx0YIdbvoXDgd RktoK8yOznbhdLRyAdwbwhgRaeZHTJunY51yF9VxToYMzwDrhpsL1cX1pmZor9+s5Z/m p3rBcmrbLWi3BVPBnTKQdo2Xo9ldK1lzJrhnmQ2EhEr0vJlE99mRbI0tGWHmXHcnH3Cl r1bA== 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=RPIA4qDpEimOt/qX64ZdH+JPLVj8CbMPA4yakNp+YWg=; b=OIH2Lx4LQk9TGXcSa2fTEPVwSqcgWR8X5hRyZ1kgUpo/qKO1pZ+fUai9JhDY8jui9/ dhe/EFtkq319cc2He+pCSIM9D2B3ff2IaZriZigW9qIsGBu8CQzAbNYGLjOG5J7QwWvQ 2h0ydEYtpi1JYSUZ/ooE5meocy/VsBZE5iQshj0LhZVWSFycF8G2hzZLmS7QbH9XZNZ/ BGafuBDIW9yvKuAlu7/wlKw1GkIM6ZyPdIEAxNsWg17mB5ymIjFnuql39/nA/t8P+Wk3 HQuh/ZKk9PcoNDkKUJc+hiEjC7wGRPGIFi8Xb9y9vt43pxzJ5N44FKLa8uycNFQy/x0m fgOQ== 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 n8-v6si12499905plp.183.2018.11.14.14.39.17; Wed, 14 Nov 2018 14:39:33 -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 S2388374AbeKOIns (ORCPT + 99 others); Thu, 15 Nov 2018 03:43:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726240AbeKOInr (ORCPT ); Thu, 15 Nov 2018 03:43:47 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBCD565856; Wed, 14 Nov 2018 22:00:22 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 396126090E; Wed, 14 Nov 2018 22:00:22 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id B8EB62239AE; Wed, 14 Nov 2018 17:00:21 -0500 (EST) Date: Wed, 14 Nov 2018 17:00:21 -0500 From: Vivek Goyal To: Mark Salyzyn Cc: linux-kernel@vger.kernel.org, Miklos Szeredi , Jonathan Corbet , "Eric W . Biederman" , Amir Goldstein , Randy Dunlap , Stephen Smalley , linux-unionfs@vger.kernel.org, linux-doc@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v8 2/2] overlayfs: override_creds=off option bypass creator_cred Message-ID: <20181114220021.GD29804@redhat.com> References: <20181106230117.127616-1-salyzyn@android.com> <20181106230117.127616-2-salyzyn@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181106230117.127616-2-salyzyn@android.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 14 Nov 2018 22:00:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 06, 2018 at 03:01:15PM -0800, Mark Salyzyn wrote: > By default, all access to the upper, lower and work directories is the > recorded mounter's MAC and DAC credentials. The incoming accesses are > checked against the caller's credentials. Some random things. Not sure what's the correct answer. It might not even be a issue, just trying to think loud. - ovl_permission() does not do the check for permission on underlying inode if only MAY_EXEC is being asked for. This kind of sounds like a problem. That means one can create an overlay mount with context= and allow a process to execute a file which it could not execute outside overlay mount. If this is an issue, it probably is an issue both with override_creds=on/off. - ovl_permission() does not check for permission on underlying inode for special file. Is it a problem where one can not do an operation on special device on host but can do it through overlay context mount. - What about creds for copy up. ovl_prep_cu_creds(). Looks like even with override_creds=off, we will be switching to the creds as returned by security_inode_copy_up(). This basically sets ->create_sid if it is a context mount so that new inode gets created with same label as context=