Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932929AbcAYQjn (ORCPT ); Mon, 25 Jan 2016 11:39:43 -0500 Received: from str75-3-78-193-33-39.fbxo.proxad.net ([78.193.33.39]:58642 "EHLO mail.qult.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932854AbcAYQjT (ORCPT ); Mon, 25 Jan 2016 11:39:19 -0500 X-Greylist: delayed 1706 seconds by postgrey-1.27 at vger.kernel.org; Mon, 25 Jan 2016 11:39:19 EST Date: Mon, 25 Jan 2016 17:10:52 +0100 From: Ignacy =?iso-8859-2?Q?Gaw=EAdzki?= To: linux-kernel@vger.kernel.org Subject: [PATCH 0/1] OverlayFS: Fix checking permissions during lookup. Message-ID: <20160125161052.GA13589@zenon.in.qult.net> Mail-Followup-To: Ignacy =?iso-8859-2?Q?Gaw=EAdzki?= , linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, While trying to figure out what exactly is going on with permission checking in OverlayFS, I found a pretty simple way to, so it seems, fix it. The problem I was having is triggered with the following setup: drwxr-xr-x lower/ drwx------ lower/foo/ drw-r--r-- lower/boo/bar drwxr-xr-x upper/ drwxr-xr-x upper/foo/ mounted with lower/ as the lowerdir and upper/ as the upperdir. The issue is that when caches are empty, any user who is not the owner of lower/foo/ and who tries to access foo/bar on the mounted overlay gets EACCES. Once the owner accesses foo/bar, that positive result it cached and other users can access foo/bar as expected. It would be nice if someone could take a look at the patch that follows and give me some feedback. The fix is simple, but a bit intrusive and I wonder whether this is necessarily the way to go. Cheers, Ignacy Ignacy Gawędzki (1): OverlayFS: Fix checking permissions during lookup. fs/namei.c | 21 ++++++++++++++++++++- fs/overlayfs/super.c | 2 +- include/linux/namei.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) -- 2.5.0