Received: by 10.192.165.148 with SMTP id m20csp2520708imm; Sun, 22 Apr 2018 08:45:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++dLL9X+G+MVd4BFzRo6XVa8xU45UgeAhdlvssWnSlar1XBefJD+MItMQ7JbyDV3PkolVx X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr18169701plb.24.1524411903406; Sun, 22 Apr 2018 08:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524411903; cv=none; d=google.com; s=arc-20160816; b=ZzHGyxUtwNluGJ+0FG3gplTIpJXxhUahsgTscmQJ5wuSljjefL3JyBoj3Bb829Cvvq XQBo9Yyw3xjPwV1cEgvnaLL4CJN8KTPr6G7MyAnB1/7hKSQa2Q5g4RQ0CwWfFg0hjjrG nF6zTHcVyjbFlCH+JWHrzJd5k2HE87T8twqo0R+HbNxOv2BZkfV2iIO0DyzVppx6XNDg Xkz22aepL/Tzv0Tyhgwljk4Tq9zkFUk7lJ3JffNVJeDtoPYUdwUZnFyinLlnR09rNvUq k1BDPWUaWOB00HvglkTv4aNdtpnrx/t7/GRj4SJmWf73mw6NxewGQ97fZsL9pxTtQZwk M9vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Yj14zskGKYfxGAcBzNisLRHkbS/KBVj8mj/Bq5lF/Ps=; b=lztVlP/LpA1Ma1nMM4UHXIRm7XHAmt90rZwgK8A5l0FUjKV6oGED0TkQk7ZZT16luc xKsCWXVJbOJb9FL/jk/rFp0ueECDhu/57kDQQnf1BY6JfmVrOCew9RtXyPDozDjlfD+O KB5FTvT9X4SmxV1oebD/d+5o5tlgjTiID3MfY3lWrP06F+RMvGPV8KgDcW6ODNs6ipBd r4a5naaNag0I3aIJRF2KkAVqQrVDmJpvIu4cIF6kOCd2hc6oQ7eVmn27UJKMwhnFtANW qa0PQsAlwCMbM2ymlxE7ZPlEWhLa7bZqCevr6wefusP8v0wO1oL0XUb/lowfsMFT5maK iUIQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si8225909plb.177.2018.04.22.08.44.49; Sun, 22 Apr 2018 08:45:03 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995AbeDVODK (ORCPT + 99 others); Sun, 22 Apr 2018 10:03:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48994 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754731AbeDVODE (ORCPT ); Sun, 22 Apr 2018 10:03:04 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9A68ACE1; Sun, 22 Apr 2018 14:03:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Kent , Andrew Morton , Linus Torvalds Subject: [PATCH 4.16 192/196] autofs: mount point create should honour passed in mode Date: Sun, 22 Apr 2018 15:53:32 +0200 Message-Id: <20180422135114.183092879@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Kent commit 1e6306652ba18723015d1b4967fe9de55f042499 upstream. The autofs file system mkdir inode operation blindly sets the created directory mode to S_IFDIR | 0555, ingoring the passed in mode, which can cause selinux dac_override denials. But the function also checks if the caller is the daemon (as no-one else should be able to do anything here) so there's no point in not honouring the passed in mode, allowing the daemon to set appropriate mode when required. Link: http://lkml.kernel.org/r/152361593601.8051.14014139124905996173.stgit@pluto.themaw.net Signed-off-by: Ian Kent Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/autofs4/root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -749,7 +749,7 @@ static int autofs4_dir_mkdir(struct inod autofs4_del_active(dentry); - inode = autofs4_get_inode(dir->i_sb, S_IFDIR | 0555); + inode = autofs4_get_inode(dir->i_sb, S_IFDIR | mode); if (!inode) return -ENOMEM; d_add(dentry, inode);