From patchwork Thu Nov 30 00:05:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 10083965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6D5960234 for ; Thu, 30 Nov 2017 00:05:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B999229D76 for ; Thu, 30 Nov 2017 00:05:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACC6C29D78; Thu, 30 Nov 2017 00:05:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 709AD29D76 for ; Thu, 30 Nov 2017 00:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753302AbdK3AFi (ORCPT ); Wed, 29 Nov 2017 19:05:38 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:51312 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899AbdK3AFh (ORCPT ); Wed, 29 Nov 2017 19:05:37 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eKCMD-0004w1-05; Wed, 29 Nov 2017 17:05:37 -0700 Received: from 67-3-248-7.omah.qwest.net ([67.3.248.7] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eKCM7-0001RU-2p; Wed, 29 Nov 2017 17:05:36 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Linux Containers Cc: , Miklos Szeredi , Ian Kent , , Seth Forshee References: <874lpck52r.fsf@xmission.com> Date: Wed, 29 Nov 2017 18:05:26 -0600 In-Reply-To: <874lpck52r.fsf@xmission.com> (Eric W. Biederman's message of "Wed, 29 Nov 2017 18:01:16 -0600") Message-ID: <87shcwiqbd.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=1eKCM7-0001RU-2p; ; ; mid=<87shcwiqbd.fsf@xmission.com>; ; ; hst=in02.mta.xmission.com; ; ; ip=67.3.248.7; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX18a3buvq7lSjqjzqwvl9GXrYIKfz6rx3Rw= X-SA-Exim-Connect-IP: 67.3.248.7 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 2/2] autofs4: Modify autofs_wait to use current_uid() and current_gid() X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The code used to do that and then I mucked with it and never quite put the code back. Today the code references current_cred()->uid and current_cred()->gid which is equivalent but more wordy, and not idiomatic. Fixes: 93faccbbfa95 ("fs: Better permission checking for submounts") Fixes: 069d5ac9ae0d ("autofs: Fix automounts by using current_real_cred()->uid") Signed-off-by: "Eric W. Biederman" --- fs/autofs4/waitq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 8fc41705c7cd..9908ecf7fce0 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -443,8 +443,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, memcpy(&wq->name, &qstr, sizeof(struct qstr)); wq->dev = autofs4_get_dev(sbi); wq->ino = autofs4_get_ino(sbi); - wq->uid = current_cred()->uid; - wq->gid = current_cred()->gid; + wq->uid = current_uid(); + wq->gid = current_gid(); wq->pid = pid; wq->tgid = tgid; wq->status = -EINTR; /* Status return if interrupted */