From patchwork Mon Oct 3 13:18:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 677731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3snjLB26Jnz9ryv; Tue, 4 Oct 2016 00:18:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b=a4utYn8Y; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1br38u-0000H2-0C; Mon, 03 Oct 2016 13:18:52 +0000 Received: from mail-oi0-f53.google.com ([209.85.218.53]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1br389-0000Dv-KI for kernel-team@lists.ubuntu.com; Mon, 03 Oct 2016 13:18:05 +0000 Received: by mail-oi0-f53.google.com with SMTP id w11so199063228oia.2 for ; Mon, 03 Oct 2016 06:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=YuWhvwhGI3/z1MW5Gk0qpoV9OiCC06TwQRNQD3ZeNmM=; b=a4utYn8YsdvMTtTr2o3w5zLL0PtpeA5zvf811o6ttfef2WPy+x531hgTc7/yYUb2tD nMQH2PSWs9PwCdKfxxL04Onn/kjjtl8LC/8cZqk6RewLfgn+ApxFtSts0tIFOumyG97I 7rtzZIa7FnUUlBjB6ayyvFUyQV1fUL0y7kI/XNb7vc7PkTmnkPYKtUHS8QqJhI1bRB8K vsmNwKVhV48tSGquwe75EbL4r+6CNCr0e0sNW4dTTkh0FvGfviN3+rUnfiuYBhtlP3qj s0Z6FoxQ5zljnD89zjhH5Lg18ECzVsU25TdrMCydpNDpi28IGoZZe1InqjVdLNkNnkBw wMcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=YuWhvwhGI3/z1MW5Gk0qpoV9OiCC06TwQRNQD3ZeNmM=; b=OYejh0UquY7qZqje1DwGY+JbDi5AU6yLh/mHuffn3GnW7duIRHHqoYOj92/pIKO01a N/6fTg8+OdWDh3d5W5c1wXMUyzAJozUfpId/8pg7yCi2+/JjWdfH0lHowG1nBrD3zm7/ C+Tm9OolVd1/dQlnP8xNBz1OklwBv/W7mj++paQVLqitbApd7lAlBilBXMhN0PoI1kPO 0nq3OoURSeBLdAOsk5Zfj7kDbKl/41vBsx3jCBCnuXpxC9UUWLwa0RBQonFRhGPrDjOe reaIZVpEVfUl5iKSMHT9sSmUjQm67LNH/tm1mYycsXy6o5bx6YNT8q4MOOxinydfwfVr IuLQ== X-Gm-Message-State: AA6/9RlTPTK+rnmY2jiPNk2QfSjnO06aMyTkUtkIfmhrmKbfqBUJeETCIXzZhOs+sL4/2kmy X-Received: by 10.202.3.133 with SMTP id 127mr17134316oid.177.1475500684214; Mon, 03 Oct 2016 06:18:04 -0700 (PDT) Received: from localhost ([2605:a601:aa9:6620:e5d2:20d6:1ac4:8003]) by smtp.gmail.com with ESMTPSA id 37sm11758606otd.7.2016.10.03.06.18.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2016 06:18:03 -0700 (PDT) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH][xenial/yakkety SRU] UBUNTU: SAUCE: (namespace) autofs4: Use real_cred for requestor's ids Date: Mon, 3 Oct 2016 08:18:03 -0500 Message-Id: <1475500683-74002-1-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/1629204 autofs passes the uid and gid of the user requesting a mount to userspace, taking them from current->cred. ca6fe3344554 "fs: Call d_automount with the filesystems creds" causes a regression as current->cred is now the credentials of real root during automount and not the credentials of the user. Fix this by taking the ids from current->real_cred instead. Signed-off-by: Seth Forshee --- This change will also be going upstream but hasn't yet been applied to any upstream trees. 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 35b755e79c2d..2b369c8ccfab 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -427,8 +427,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, memcpy(&wq->name, &qstr, sizeof(struct qstr)); wq->dev = autofs4_get_dev(sbi); wq->ino = autofs4_get_ino(sbi); - wq->uid = current_uid(); - wq->gid = current_gid(); + wq->uid = current_real_cred()->uid; + wq->gid = current_real_cred()->gid; wq->pid = pid; wq->tgid = tgid; wq->status = -EINTR; /* Status return if interrupted */