From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailhub.sw.ru ([195.214.232.25]:10756 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932688AbcCOMKq (ORCPT ); Tue, 15 Mar 2016 08:10:46 -0400 From: Pavel Tikhomirov To: Andy Lutomirski , Seth Forshee , "Eric W. Biederman" , Cc: Serge Hallyn , Alexander Viro , linux-security-module@vger.kernel.org, linux-mtd@lists.infradead.org, selinux@tycho.nsa.gov, linux-fsdevel@vger.kernel.org, Pavel Tikhomirov , Konstantin Khorenko , Pavel Emelyanov Subject: [PATCH] fs: remove excess check for in_userns Date: Tue, 15 Mar 2016 15:09:00 +0300 Message-Id: <1458043740-14229-1-git-send-email-ptikhomirov@virtuozzo.com> In-Reply-To: <1451930639-94331-4-git-send-email-seth.forshee@canonical.com> References: <1451930639-94331-4-git-send-email-seth.forshee@canonical.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: If in_userns returns false mnt_may_suid also returns false, and we will reach second(removed) if-check only in case it does not trigger, so remove it. Signed-off-by: Pavel Tikhomirov --- security/commoncap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/security/commoncap.c b/security/commoncap.c index ca0c04ae..82f930c 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -445,8 +445,6 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_c if (!mnt_may_suid(bprm->file->f_path.mnt)) return 0; - if (!in_userns(current_user_ns(), bprm->file->f_path.mnt->mnt_sb->s_user_ns)) - return 0; dentry = dget(bprm->file->f_dentry); -- 1.9.3