Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp528571pxj; Tue, 18 May 2021 08:38:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynBffo81NqeMPTs1yXggOtCCKfN6TlGy36QUu0NBVLxsEanAjAoLp2XyTDFOJDva9yczDK X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr4840588ill.248.1621352310743; Tue, 18 May 2021 08:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621352310; cv=none; d=google.com; s=arc-20160816; b=yVs++zHMXJpCzP/UBTuCHzAX82tQzspeSgiZbasnzw2UvmAzHnrY3rcElenNxdRxBg jgHfz0mEJ+1nsCw++oGFIGTeKFxjf0CQUzY0mZY0/GbGrN1xoQ4ffmAbbTtLz+wbHpoC sZVQKI6oVWvTrYKztQeKXVXX7sg09sMvgv1culj2LqzI7lgzLevyvyuMpPdIyRFkh55E NM8HzkikzP1AUK+3/oEXzcIPIo+l9IkNhzf4gEovAguSkEg6/slone28t6XQmlGXT5Gg 7uMe68DHQgKDpMO83uCM9tLMr1/3c0A0M0c6ruyiDlotEevD12CPls/ea6usRmg3/Tb3 sDJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/Rj3PlZqLGmWbNkHqqBte2xiQtTzOfvdo+VOC0J6ioY=; b=nHy+z7NwKeEMGnkcmJFE+rjMBRZFHWw5GYcuAOgEm0xBCVS9efgd7t23FkI9NKqsdA DPmQugPM4rgEIvuvdraMElvy3zw/dwQcDrHFUgsG5gEynme9NnnmXSU8U2hxltXl1nES pqNHZ8nzs5djNlILfj7WoMZ55GIeCBI39v6fR4cvduXn4WUeZZrVN1D5J19mzLm4uPI5 0cF0hOMfJb8xodRoKigsd0JjfMkSND0fVb64SUOTOKAIYn9BJk8oTX2PCqEj1eqIvUqA AFOY1FOgsF6dlfqZeQVGrIKIJlom5RMfxsu93k7QrzMpNieO7HNiqs3oqEljC+ol8du6 ct3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3ToTHAg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si19812346ioj.71.2021.05.18.08.38.15; Tue, 18 May 2021 08:38:30 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3ToTHAg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345578AbhEQP4f (ORCPT + 99 others); Mon, 17 May 2021 11:56:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:40300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244224AbhEQPg5 (ORCPT ); Mon, 17 May 2021 11:36:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A48661360; Mon, 17 May 2021 14:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262417; bh=a4yamCC8qnVv/cSRaTHuXgN9RNgwx+1LS01fGTGFiGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3ToTHAgP3Zd+jGF0If6wqM06WMQHUuFBhC/fwDDsw2DP/13zlW699V211vFRovh5 6K2QJlxiGiS5aew5+L7dklBVU87/agbPQVWM+K2DGcZ3gaxMO5W3PCcEeEODenui8Q V5IhCnZe0IiP6mqZ+mIhux1yGbSTFhknDa43x9Jo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Christian Brauner , Alexey Dobriyan , Andrew Morton , Linus Torvalds , Sasha Levin , Greg Kroah-Hartman Subject: [PATCH 5.10 183/289] fs/proc/generic.c: fix incorrect pde_is_permanent check Date: Mon, 17 May 2021 16:01:48 +0200 Message-Id: <20210517140311.269772793@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit f4bf74d82915708208bc9d0c9bd3f769f56bfbec ] Currently the pde_is_permanent() check is being run on root multiple times rather than on the next proc directory entry. This looks like a copy-paste error. Fix this by replacing root with next. Addresses-Coverity: ("Copy-paste error") Link: https://lkml.kernel.org/r/20210318122633.14222-1-colin.king@canonical.com Fixes: d919b33dafb3 ("proc: faster open/read/close with "permanent" files") Signed-off-by: Colin Ian King Acked-by: Christian Brauner Reviewed-by: Alexey Dobriyan Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/proc/generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 6c0a05f55d6b..09e4d8a499a3 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -754,7 +754,7 @@ int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) while (1) { next = pde_subdir_first(de); if (next) { - if (unlikely(pde_is_permanent(root))) { + if (unlikely(pde_is_permanent(next))) { write_unlock(&proc_subdir_lock); WARN(1, "removing permanent /proc entry '%s/%s'", next->parent->name, next->name); -- 2.30.2