Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3867197pxb; Tue, 17 Nov 2020 05:46:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc7poS1lsaBeXE8++uey9OqsFLgUtNCeAZhfQdTVYLKPR+DLL+tR9aaBHtDbc9pNGUb/Wm X-Received: by 2002:a50:d490:: with SMTP id s16mr1920334edi.187.1605620791805; Tue, 17 Nov 2020 05:46:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620791; cv=none; d=google.com; s=arc-20160816; b=jplfkHSh3tfsQ9piF2hXIB0PqAFmaTNxmHxOnYkMwdn0GFShBunDQzBwNMoEx9zhlZ eRdRjugoCc+pFBU+29WcN25MeMKXhu6k5F5KDQvmNB3b31x0cXh/JLRq5tjPppLzyd0F JRqar0GON4Gz/WKKufLdXa50lohpXrG5bkjGvy7xQoBNi/XpDCBVgIpjQZ3vEIWj/BF2 SfQ+VTTUTDC6qy5vueM41LTFRzPC84BW4QXMp90lqJ4h4NZytNlyJw/NWWutgLMqo8Sz mbd+E8pRVOnHyE7H/GkT2uVlRN45kwdS0lHRE+X8+71cPYJyuILksfIL3dOB+Mr6vUR9 CFtw== 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=bTgeeFofI04ooj46Rk33ymXaPJyyL0gZswZZUicbE8M=; b=CBX3whJ5xnu6j2KdLLsJKdVYt4c2lnVUp6osc54+37dTiHzIDAv6WMgr801bS4daFx x28OxSwfvY8Z5di3ypPIFx4n+LkSd+DHpU5qT/Phuyd9ut/Aa6HNAJqcEcgc+7wmljAE vyTHcuTWIk778GxtZ82e2RWPK5nhDkHgKQAGD0O1Yr/8e1WXH3753/9MIoHtZ2+J5Cnr Y3KcljXDHcf027OszJrtO95QlaDFxSyvO2Y5GnJm32x91alB4NrO8I0yltXduW/xjYL7 2CVA1qELzRtEneQt6iBb2McysdR5eMOi47q1tB3uBgoduj0aCXrXd7GpyAVXPmokgnso rJqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kyRSLbgw; 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=fail (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 p22si14262633eds.42.2020.11.17.05.46.08; Tue, 17 Nov 2020 05:46:31 -0800 (PST) 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=@kernel.org header.s=default header.b=kyRSLbgw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387467AbgKQNmp (ORCPT + 99 others); Tue, 17 Nov 2020 08:42:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:53488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732521AbgKQNlM (ORCPT ); Tue, 17 Nov 2020 08:41:12 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDFA120870; Tue, 17 Nov 2020 13:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620471; bh=XGQzUUIqVdnBFX5aIgJkBe9k651L/X8WLIcid+bDbdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kyRSLbgwSSnD3ReRiG3Z2U8x5kWwbRmD8Dc8KlBPx2j5UmkEMIYSxXkMRq9dqLUOp hqbz0RSJkQUfrjIeqqbxrZZX+RJocNGgHnO0KPD2MjQjYJhtMxnnNiHTkeWP7AakAX 578DTCxI6D8scX5qARbQo7lRqkH/VSwc1NbV/rUo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kris Karas , "J. Bruce Fields" , Anna Schumaker Subject: [PATCH 5.9 231/255] NFSv4.2: fix failure to unregister shrinker Date: Tue, 17 Nov 2020 14:06:11 +0100 Message-Id: <20201117122150.181446172@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@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: J. Bruce Fields commit 70438afbf17e5194dd607dd17759560a363b7bb4 upstream. We forgot to unregister the nfs4_xattr_large_entry_shrinker. That leaves the global list of shrinkers corrupted after unload of the nfs module, after which possibly unrelated code that calls register_shrinker() or unregister_shrinker() gets a BUG() with "supervisor write access in kernel mode". And similarly for the nfs4_xattr_large_entry_lru. Reported-by: Kris Karas Tested-By: Kris Karas Fixes: 95ad37f90c33 "NFSv4.2: add client side xattr caching." Signed-off-by: J. Bruce Fields CC: stable@vger.kernel.org Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs42xattr.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -1048,8 +1048,10 @@ out4: void nfs4_xattr_cache_exit(void) { + unregister_shrinker(&nfs4_xattr_large_entry_shrinker); unregister_shrinker(&nfs4_xattr_entry_shrinker); unregister_shrinker(&nfs4_xattr_cache_shrinker); + list_lru_destroy(&nfs4_xattr_large_entry_lru); list_lru_destroy(&nfs4_xattr_entry_lru); list_lru_destroy(&nfs4_xattr_cache_lru); kmem_cache_destroy(nfs4_xattr_cache_cachep);