Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp643620ybz; Wed, 22 Apr 2020 05:22:14 -0700 (PDT) X-Google-Smtp-Source: APiQypIRqIo2xdFrJuScfqk1xKZSfidYSIJbdHX3CXO0UsIyPgaCasXqPJ6CkFOxvJI4pmeD5iAl X-Received: by 2002:a05:6402:17c4:: with SMTP id s4mr23494049edy.348.1587558134288; Wed, 22 Apr 2020 05:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587558134; cv=none; d=google.com; s=arc-20160816; b=LBxMvrNTijVuovX3OWecmq9pIVGT6NE59ADXD+vKFJEjgrupH3Cx4eUj5OfKoMwDUm PTMsxBrGRLRPSwXQqDqHSnmcw+ec70ERkuOjqASphL8ltlU1r9/2HwvESqhfb/KVAh4m KCM3UpGgOdV3cW2hrYwoXg/bdemxnpbxvdCyfSp9IW+w3tkHT+P2Y/mfGwa7Hs0Wk/JG lXg826kTTuz+Z9wOFv3b6eRfb1WTzCnmXeWm87rg3KwQ7CT6ufWuBTqE2Oq00ohZMsms 380fRYjAghTd9zUfFTBrxdlFoy+tC5DthsCsc5uKH7jWFfzdu7bFliCJce5KNflKN5Mk Efjw== 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=X/aYAwcqRCmGjiTD28St7C86O7Z4JlpyMP7GRdRTra0=; b=uJh3HHxIhUl/EF5BeuncdzSvhro4orIou7JZTETIqqts6W3VcCUjKEGAgOAufwML9c qnZSYpW7D74Au0p3TNRGz/qu3x5U3to6+63uUvLEUpqf4x3ZUU0rEx4Dj2Q8E1O9Xe3b Enpfc8Cst2AsGEixxyL0QkrX664UtegBA38vdYX08L67EQOec+TPn136WjBfpLwFgHaF ws7gSF33DfwPKMwz9+XFM7aM/lbBF56UCWt1DCqs4rpp2Y0xzz7AeIHOq46TvkLuspXl HH36i5g+8kHcXYBeQKmJr5Wjexy0R8SPRpb812Fd7xqyWmRaaOk9M29Ddpubp/n5QLZ9 vsVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mlB0jsbP; 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 h11si3539999ejy.116.2020.04.22.05.21.50; Wed, 22 Apr 2020 05:22:14 -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=mlB0jsbP; 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 S1729168AbgDVKLO (ORCPT + 99 others); Wed, 22 Apr 2020 06:11:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728601AbgDVKLL (ORCPT ); Wed, 22 Apr 2020 06:11: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 EFE632075A; Wed, 22 Apr 2020 10:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550270; bh=Q9whGS9I7eP5LIjRdf2IV6LOnzGxAaVCgwyaoGN0xTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlB0jsbPrV9EE5fTgx0w0HwcwueyXucn025jQUxvStIGILw0LeinbyAD49uA6bP1n MA1wsuX3HnkftpbxBc0v5gFSEaMuM+aVSkRTfuW9wMQESNdIKlG6kXgQzCXce/VjRC H1BbWn0VkAqQxvnrnp0hw1i5gnczj5sRVP/H2vLA= 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 4.14 078/199] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() Date: Wed, 22 Apr 2020 11:56:44 +0200 Message-Id: <20200422095105.929844808@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095057.806111593@linuxfoundation.org> References: <20200422095057.806111593@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 @@ -279,7 +279,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)) {