Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2122744pxa; Mon, 24 Aug 2020 06:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtW8jQJl7+vzY1DKLnGU7u6SDVAk8tl4rsgg1NgbjTx+DTpT98Ufwfq4ra7PM2Kl6Xm3XE X-Received: by 2002:a50:9fe6:: with SMTP id c93mr5056248edf.286.1598274022440; Mon, 24 Aug 2020 06:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598274022; cv=none; d=google.com; s=arc-20160816; b=A/Mi84tyf26aRo+kot4/5mMpOvDyL+ndRcC4GZTg5T8Jjap2wdIBxYfmZG6Bwh9DcH CpnDnTjFqe7SsEm57rzchcLYNfGDeqpD04IRl/ytFl6LnKh4upXkzcZMFPXxjuS+u8Ub Sjjuu771eR4n3oSor0Hm2X5rCzo6RWN/ccPdPQYKQQUL/j0NZC56WtoXg7sNMtvirbzL Ru4wAbLc3eWXQoLys+korzJUpBA0BG/nYKxS2X0qjpv1J18cHHobBWLr6F+Z21s5hEcX TCXUsCJbV0V5jTIxdFv0YgJpCX62URmzVATtSG0lUzjoV3YsUF5qKZ/P2dEwVOnWvZvd bAfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=rmefo9JeNKbiRxEroXLrRSeRCr+DW21/6Xw4UwzMQoc=; b=rDz9cL93kZYP6vPe7UAF5QJIVs4wnzr/2Na9vrjnR+05bN7bRIGcXsuVKNpx2f7jJe CLmN4iiKvnuPsiCbSR6inQdm7shM36WMy8AWKMFvy2QDDFBqq1gfO08Wx7j8a3uAwVNj qFMMinVO/QMAZKI+KoK5ot+0gS98gcendtdV9VhwiJDv0DuNgW5+WhZwlzSacJqOiEeY dz/XFZ0onqI1rzQskvXfgG10CgCoxNew6VzUx1Y+e1zdeFr3uGIvtb1gmz3wJGyASuoj MBDLFd9G/kFeCwtiS/UEWdS9Qa2fA+UmbGzhVJ5N4t++4kKdjemlOiqvdMOcv9QsIGrT +inw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z93si2146528ede.195.2020.08.24.05.59.59; Mon, 24 Aug 2020 06:00:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728073AbgHXM5J (ORCPT + 99 others); Mon, 24 Aug 2020 08:57:09 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:47083 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726799AbgHXM5A (ORCPT ); Mon, 24 Aug 2020 08:57:00 -0400 Received: by mail-lf1-f66.google.com with SMTP id v12so4209177lfo.13; Mon, 24 Aug 2020 05:56:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rmefo9JeNKbiRxEroXLrRSeRCr+DW21/6Xw4UwzMQoc=; b=XcKMfPCEpXGeYjpqTmoaXolEKE/Ivw/H1eykj8pfM7ZYKbv2kf93GuTy0GlPL5r7tf mhNYlITtlA2qU1TzVpRoN/STVT6I4Bix+G6hbbQ524s2bINamWMzscCB11E5wRojTv41 xacrMeFKBgS7cpfwZgaekoo2V4UYjxNVpdiZAJc4D7xfMIylJ4nmgX3pK7kfMYRlUYFU 5HWMdarsdfFS27PSN0p3fe2V4hI8za2O586oUwFmEnyu8SZ5S4wXGikHyA6KWLEHtTVa nkwPX6VDGtEw6VAfa3Sa3G6UGAyqgWSPWpfZImhodl/xMiJ0UtU+j+kNibsTYNB8VucV 2hsw== X-Gm-Message-State: AOAM530qxg7LlFbAjSUznbp4I7dlfCBUxJ6WftbS8YsakrLVrGXC5tOv 3wMAJJTGlmkc1+ezw2rLgeI= X-Received: by 2002:ac2:46d4:: with SMTP id p20mr2560894lfo.109.1598273817247; Mon, 24 Aug 2020 05:56:57 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.111]) by smtp.googlemail.com with ESMTPSA id z18sm2171906lji.107.2020.08.24.05.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 05:56:56 -0700 (PDT) From: Denis Efremov Cc: Denis Efremov , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] namei: use current_fsuid() in may_follow_link() Date: Mon, 24 Aug 2020 15:56:32 +0300 Message-Id: <20200824125632.487331-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify may_follow_link() to use current_fsuid() Signed-off-by: Denis Efremov --- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index e99e2a9da0f7..1a47c9d8ce13 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -958,7 +958,7 @@ static inline int may_follow_link(struct nameidata *nd, const struct inode *inod return 0; /* Allowed if owner and follower match. */ - if (uid_eq(current_cred()->fsuid, inode->i_uid)) + if (uid_eq(current_fsuid(), inode->i_uid)) return 0; /* Allowed if parent directory not sticky and world-writable. */ -- 2.26.2