Received: by 10.192.165.148 with SMTP id m20csp2465859imm; Sun, 22 Apr 2018 07:37:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Dxft6OlRdLNHOrw4bqGSNF2AE+hNTj5HkmUbQ1SqGGzb9aOrOCeSiNkg/R5/LVtpbqbpz X-Received: by 2002:a17:902:10c:: with SMTP id 12-v6mr17699107plb.252.1524407832512; Sun, 22 Apr 2018 07:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407832; cv=none; d=google.com; s=arc-20160816; b=oGOUOutlKfmiEXPsLYdJO5Pvoq7xAwjueoFoWuTaQh1ybYnxY5YZ9jEQZbuNy6+WR7 TUHWm86vTQh8xXrFQ0YR9fbFf1IYPNr1bE6Lc6AGS4/aeucHdpSrrrtd961OS+06sPf7 t+9daiBiRZuD4xxMIJLoCjqIvA1NghS8Vq/s0eBkqL6qnjhQSxPhinnxa+Bt8eQihv/a v6bk07vy5tLqSXHQBGkgjxhnl0Lvv4GeJtmk6GH1dOCBj6FjjGP/xTWTRVx5IxmjnpK/ 4n+j5iidn9qKd+2vHC3Wx4RT+SuZhhaU9ckE8h175wfpY3waHYG/88NxEg/b3tXwCKPD xpjA== 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=NBprD9BUEGl1EVnn1tlGZ1QRWqKI9OpnCmayTEbcQzY=; b=zth62/ynNwrYy2RBI00kCoaVoqHWzhYmvgj/iJc6SA45ayz4pNElFQp/f79F9w0dnd fdRbCXGVmRn4xarivagCimBGy59bZR48jfym6T6M2R0pvJqmY0d0gzo7n6SwikvQIpcR pPU55UNTPa2gk2Wd3LIXqDLVIcEe7qJMQxQW1b6Y0gKJUOGOSatxouGE22VUUFXheQwk OU8RVikJ/Z0Q4teVAReTJ2ebl1PZuztRw4SH8Sspz/Z6RlRrRF1xTcOCuBh6Cg3VD3Tt a9LMSeCjSiNuYH3idEGxk6HjDI8KPLuAwRDRiAgxgUuchYI6opA+8+LZ0jy72HuJigtD yCYw== 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 v12-v6si10309054plg.180.2018.04.22.07.36.35; Sun, 22 Apr 2018 07:37:12 -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 S1757368AbeDVOff (ORCPT + 99 others); Sun, 22 Apr 2018 10:35:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59554 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932591AbeDVOTR (ORCPT ); Sun, 22 Apr 2018 10:19:17 -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 8BCD7BC5; Sun, 22 Apr 2018 14:19:16 +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.4 92/97] autofs: mount point create should honour passed in mode Date: Sun, 22 Apr 2018 15:54:10 +0200 Message-Id: <20180422135310.216442138@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@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.4-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 @@ -746,7 +746,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);