From patchwork Sat Jan 21 14:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengen Du X-Patchwork-Id: 1729945 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=gFq91wbP; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nzdvq46t1z23hH for ; Sun, 22 Jan 2023 01:26:14 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pJEol-0006P6-Ex; Sat, 21 Jan 2023 14:26:03 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pJEoe-0006NH-VH for kernel-team@lists.ubuntu.com; Sat, 21 Jan 2023 14:25:56 +0000 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B428442535 for ; Sat, 21 Jan 2023 14:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1674311156; bh=jb8Yf1HLtnDm5MHRwRkFvsC9vzfKrGHMLMvadEgc4Zc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gFq91wbPqOyW9S4194K/9xZ7TAHcBY/yO8HA7sxBR8MvXzfqxbxKxUQntadfYZ3xg xk3OAkhc90iPYnuJDidtBzVDY1YtDhXM6L8Bl2xasu+ZHeBt/DfrJO/VoJbOXgeqms zINPsvLZjlf8qR9z6PWvpDv40/w0aOXWxxpK0eB26uQuEkQ783s1gkuP7IJF0d5XC/ l30j8KdQhGHLZYclRNoZCxmlwGi6xN0uDhdcDV+DcQlJ6HOvJtKgw3muhmV7248u4z zv2GV5aqMkoqS1V76/YZBkRorvAqzs512VemgNXNgTmCX6AMJDCmiIRQjFUVLS9Gsj pH9Q6uBc2CmdA== Received: by mail-pl1-f200.google.com with SMTP id m7-20020a170902db0700b00194bd3c810aso4386589plx.23 for ; Sat, 21 Jan 2023 06:25:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jb8Yf1HLtnDm5MHRwRkFvsC9vzfKrGHMLMvadEgc4Zc=; b=z4fTO0K7JP8vOZjO1sMXrtQao+ZwvfquuqGm1Uc7a3ugm4Al8qYBLSpYCe6HcD2Y41 JRK7+NSxVyDTn5xTtm0r0kQLvlGLpC3wwuqMfv5+gkkcbDJ4qPPYsm8DOtH8M1lPe0D2 q0Bojl5yMu/v98HoSUI12T1hsOBuhMxs5n9DyV3Uq49x8WQ3W1EQYR5ve+Xe3rYCzk9r Vu7aEV2Hbhp7oyGm/Ed8jBdYJPo6k3EMl+msc1j+pC7yZ2hItFR0Pz8OE42x++oCbOZW /PklpDABOKK/ln4A3RSNpBj9sfaxqFSq4xdd+xf8cD6bmoF9uMxLa2y1qKMsOJmrgs5J KIcg== X-Gm-Message-State: AFqh2kqEa7P1Vimb9J7GK1Xqf5o4WlogM0NJvZaVcvZk9UGNWHpm3iyn xJcmadZHFN6Pwf6DVW9oMeDWdwsCqf3iJZgiqhMnvig8AOUd2560iyUFSeTFDFggTtz1Z4D9/Gh 277tyDgfva3E4aQnuvcKC+VkQq7T+PLlmiuaNpDZDCQ== X-Received: by 2002:aa7:85c4:0:b0:58d:bb58:e928 with SMTP id z4-20020aa785c4000000b0058dbb58e928mr17630198pfn.32.1674311155226; Sat, 21 Jan 2023 06:25:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXvWvuiC2In3f7qYMy7urKUPvC3POemGmIDCqIAx/+CcrJ9kdi+TeUG6eUDxVLVLKo55zlqWyg== X-Received: by 2002:aa7:85c4:0:b0:58d:bb58:e928 with SMTP id z4-20020aa785c4000000b0058dbb58e928mr17630188pfn.32.1674311154981; Sat, 21 Jan 2023 06:25:54 -0800 (PST) Received: from chengendu.. (111-248-116-144.dynamic-ip.hinet.net. [111.248.116.144]) by smtp.gmail.com with ESMTPSA id h124-20020a628382000000b0058bb2f12080sm15569586pfe.48.2023.01.21.06.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 06:25:54 -0800 (PST) From: Chengen Du To: kernel-team@lists.ubuntu.com Subject: [SRU][Kinetic][Lunar][PATCH 3/3] NFS: Fix up a sparse warning Date: Sat, 21 Jan 2023 22:25:49 +0800 Message-Id: <20230121142549.37283-4-chengen.du@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230121142549.37283-1-chengen.du@canonical.com> References: <20230121142549.37283-1-chengen.du@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Trond Myklebust BugLink: https://bugs.launchpad.net/bugs/2003053 sparse is warning about an incorrect RCU dereference. fs/nfs/dir.c:2965:56: warning: incorrect type in argument 1 (different address spaces) fs/nfs/dir.c:2965:56: expected struct cred const * fs/nfs/dir.c:2965:56: got struct cred const [noderef] __rcu *const cred Signed-off-by: Trond Myklebust (cherry picked from commit 5e9a7b9c2ea18551759833146a181b14835bfe39) Signed-off-by: Chengen Du --- fs/nfs/dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 691ad507841c..881a8301ccac 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2910,12 +2910,14 @@ static u64 nfs_access_login_time(const struct task_struct *task, const struct cred *cred) { const struct task_struct *parent; + const struct cred *pcred; u64 ret; rcu_read_lock(); for (;;) { parent = rcu_dereference(task->real_parent); - if (parent == task || cred_fscmp(parent->cred, cred) != 0) + pcred = rcu_dereference(parent->cred); + if (parent == task || cred_fscmp(pcred, cred) != 0) break; task = parent; }