Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1383787ybz; Thu, 16 Apr 2020 08:14:31 -0700 (PDT) X-Google-Smtp-Source: APiQypL3CmOj1TyeDjhY/6wilJlcl/FWI2U14tIuNkCP5NtH0jBLXr7GcwgE22eOTt/i0QNB5tzw X-Received: by 2002:aa7:dd0f:: with SMTP id i15mr15148533edv.245.1587050070552; Thu, 16 Apr 2020 08:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587050070; cv=none; d=google.com; s=arc-20160816; b=UhStYg8e02Q9els6R7igWkN2QCDlpCzUJfflnyV3Cp+bYl/sgYQdUEJXbeVj5qw6Lu T1b8Hn4NmQDMmJ+42IH9+EbBq8alz7z98haHgkQCSLYT9dManNdPewnpKnqoc9XzfcMh w7PLMoU6QED6Vo+EBp1+LTQaRkXc93r8s9Reia7ktGGV0RaDPdW1bY2RSJ9bA4fTgHeA nwYJ2OPN+/dtI9bI7zUy132clsImhTxsJfD2btYDE8b7hCsQV4zf9/ILGyVSj5z9NryM 2AlaeE6/8MJB7iC9q1tnHARgmAV0LbdjmYEo2dAJMxDfSbYxxa6OdGLZEY2ha5TV5NjI ufEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HiSqzpmo+kbmR6JG6GFL08E4jD6aqciSVTniMP5QQb0=; b=uCh5SA6h7PPZ71H8XbSoaKw3iQAukzvT65Lf4Zti5E/rGo22+jvHeGsH2CJojZxN6H T+N8CO0uJUJ9/cVOzMm8NbCt9gLLvdpVmvs/FGedpRjyFLb8y1C8UDvkQkX6xXfob0Sd WtNkhXvJanY4ub+7vQGfdcGZedEsYux/lBbPsnMWjbSJrO+KWm08Wx1TkFARFs6m/2MQ OVJpxGbjwV63Su/YRy6podaaplpnzRZWj52fnE/eygwGAkRGDYfDunfiOxXXzWWH9G6O sfLAnHyNz6c9Uka4fMJqwTMD2sG5IKyoJ1/EiJU4umhKTeHZ2Gxav51sx5yPri0ASpIg 8bmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pLz1A5Fp; 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 a23si2857334edy.27.2020.04.16.08.14.07; Thu, 16 Apr 2020 08:14: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=@kernel.org header.s=default header.b=pLz1A5Fp; 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 S2395002AbgDPPLu (ORCPT + 99 others); Thu, 16 Apr 2020 11:11:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:36116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441671AbgDPNuL (ORCPT ); Thu, 16 Apr 2020 09:50:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 ECE53217D8; Thu, 16 Apr 2020 13:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587045009; bh=35DQCoLhU4IACeOnSBXyrN4iKj6AcylTdXMZ0STztX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLz1A5Fp2SVTEkZ52U11Q3l4wWt7pjLgu1lTYqFxwsbEz3SDO6YjoMsRE5qAxrgf7 rA9qetYNVS7OVSXGRTyvybBo8JT1Puyzj+o2o5byWdh7yGMutmos/LZaWX9fdu5gAv Cyc7FxLelaOyFWCTKOkqfSkmGTo81iC5Oq8xXftE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Andrew Morton , Jessica Yu , Alexei Starovoitov , Jeff Vander Stoep , Kees Cook , Luis Chamberlain , NeilBrown , Linus Torvalds Subject: [PATCH 5.4 193/232] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() Date: Thu, 16 Apr 2020 15:24:47 +0200 Message-Id: <20200416131339.304534097@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131316.640996080@linuxfoundation.org> References: <20200416131316.640996080@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers commit 26c5d78c976ca298e59a56f6101a97b618ba3539 upstream. After request_module(), nothing is stopping the module from being unloaded until someone takes a reference to it via try_get_module(). The WARN_ONCE() in get_fs_type() is thus user-reachable, via userspace running 'rmmod' concurrently. Since WARN_ONCE() is for kernel bugs only, not for user-reachable situations, downgrade this warning to pr_warn_once(). Keep it printed once only, since the intent of this warning is to detect a bug in modprobe at boot time. Printing the warning more than once wouldn't really provide any useful extra information. Fixes: 41124db869b7 ("fs: warn in case userspace lied about modprobe return") Signed-off-by: Eric Biggers Signed-off-by: Andrew Morton Reviewed-by: Jessica Yu Cc: Alexei Starovoitov Cc: Greg Kroah-Hartman Cc: Jeff Vander Stoep Cc: Jessica Yu Cc: Kees Cook Cc: Luis Chamberlain Cc: NeilBrown Cc: [4.13+] Link: http://lkml.kernel.org/r/20200312202552.241885-3-ebiggers@kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/filesystems.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -271,7 +271,9 @@ struct file_system_type *get_fs_type(con fs = __get_fs_type(name, len); if (!fs && (request_module("fs-%.*s", len, name) == 0)) { fs = __get_fs_type(name, len); - WARN_ONCE(!fs, "request_module fs-%.*s succeeded, but still no fs?\n", len, name); + if (!fs) + pr_warn_once("request_module fs-%.*s succeeded, but still no fs?\n", + len, name); } if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {