Received: by 10.192.165.148 with SMTP id m20csp2478514imm; Sun, 22 Apr 2018 07:54:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/LUnzuxnIjFpa5KeY9EEzxJjsn7FCFD1YuzrX6GmhojZzMP7iqV2zWqPUyYAJ4xMr64oS X-Received: by 10.99.100.69 with SMTP id y66mr14355083pgb.206.1524408840145; Sun, 22 Apr 2018 07:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524408840; cv=none; d=google.com; s=arc-20160816; b=HAm2siUZPufS5LZuOApZvcid7iE/hsOYbqfzUABdSUFIL8Jy223M+QBSxCh+ourBjr lV+aiHDh38sZQZKPlOVLhzXFYx7QPB2S8fO6qOieyuI/gzS9g2P3jZUo8kWP/qr4tT0k j3hFoSJCuTv+K3VYOj3Cue4rEalMvrzTeQ7q8bxA4xZBSO5o10imLJQxqm8syKeJ/Peq gguf8K3OCJeLXKnASZOe9GsGgjcI9NCIghh0GDnUpvP2+HJoCmz9WcKl9UL6MnDEeO95 V6fyczkD2AN7cgwCiQ9heN4n4+ShZrPbpUu68V0Z347fL1a1RvO84cyFomuT84qZdi4w IpXQ== 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=upzuxZzo7QRNgqgw9UwmoXMkA9K4FKkNO2RFb4FpwZY=; b=Om6mMXKnf4A+dYFF/r+oA9kgyr6f0dBHiBZ9betUZ6kX75HnHt+ovnuIfNdynyX9ZP 0U9iNjudPxpt9gyPic5jUl9ktM/FP9np+abo6eIERaLpzLqLUW/H4SHf96QEN+i9wJlt EkyeZE5fZZX1OU0Vdj07ygE1/Fa72sCCbV8VN0GfG0DqxXOvdDMb/rFBZxokT6RxKFZy MusltRInF72/lIBEi7UP9mDYUzulKb2C0pSw7t+86G7uWduGDGh0Q89CuvwYcxO/h3P2 OY0QhB7DosSnXG2us3+2qIDawGjyQDQWnX8ES+iKM9jrnaRNwrubsH3AKGvAOTxcdIH7 UCjg== 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 v196si8396380pgb.460.2018.04.22.07.53.45; Sun, 22 Apr 2018 07:54:00 -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 S932107AbeDVOO7 (ORCPT + 99 others); Sun, 22 Apr 2018 10:14:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56602 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbeDVOOz (ORCPT ); Sun, 22 Apr 2018 10:14:55 -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 50117C1C; Sun, 22 Apr 2018 14:14:54 +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.9 91/95] autofs: mount point create should honour passed in mode Date: Sun, 22 Apr 2018 15:54:00 +0200 Message-Id: <20180422135214.147188186@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@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.9-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);