From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-6.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id D34227D8D5 for ; Wed, 14 Nov 2018 22:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388495AbeKOIns (ORCPT ); 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-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@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=