Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp913492ybh; Thu, 12 Mar 2020 13:26:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvPCEnCfdD5LamuQlS6M7IkGV9+Uhwjt+laErJ6l/nY48YKN6mq+NrtgqvjzKTsU+1qmcK/ X-Received: by 2002:a9d:4508:: with SMTP id w8mr8528386ote.154.1584044813372; Thu, 12 Mar 2020 13:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584044813; cv=none; d=google.com; s=arc-20160816; b=R0sA9DuCTrahmshFRI3v980v8bCO4yaWiu7CnuKZkUVvsUqkZwfStHjin6kaZPpaPt SydE5TaUeC1RyXegF3lNmCxxZ1uYPRblKzMloR+dnAQpYRW5CT7zFNYaSEd1sG7kMwdK 1mMbX+QKgrADvIQSuJdZ4qDIVxlAybP1rqAm3aE/MTuYRcn9wBBjLj0fOXE3uUsr/Dw2 IVWeU7CwYWazCJxCjOSkh8KxGZijcqS7SAVlO2sKRqFg5Wp88ZqBDS2ZnwYtYdmh0/Mn 4BSfP3pbvzL6Gcuddg6jNk8zy0INZM/9QnGQAvV/d16Xl2YkM5ll8KAgR2bUStrEQdjl 1a5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dnWjDrNTNoisMt1lQ3C1OQ9SkVntlqHiLBwBSZf8QNU=; b=E6es19wbtBeXEp0xA/KpNcWEen0j91hCP8eyyfHv+MBVrAzoq2P7jJGlrBBdv09it/ cLsBAjOMw0pGQPSlSfYcoU6JlpMRKBKDqsJQi+bRC4Y2rbV9pTZ66gMXFekvxsuLxWwV 4ItTcptqLnwnIG/bj45dl6q7SgkrCT0BDoTce+iPV4z39t++viOpOXViuZPgiUN9UTQ9 wErxqwLhlsNx9s7oiGC7Ep8lDx1ZI5V6ZNfP6AA86l3TMVqUYO+VO32w5cxTRKF93Rne v+F0BeAQCnC8w5wVQ0Mb5dLlhan1G8S1L7APxjAIfiYZU7exXvqraL6c4maZU1pJWPhU T+Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2j95iuZl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si3337750oti.155.2020.03.12.13.26.40; Thu, 12 Mar 2020 13:26:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2j95iuZl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbgCLU0P (ORCPT + 99 others); Thu, 12 Mar 2020 16:26:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgCLU0K (ORCPT ); Thu, 12 Mar 2020 16:26:10 -0400 Received: from sol.hsd1.ca.comcast.net (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AD8520736; Thu, 12 Mar 2020 20:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584044769; bh=bWBPGbnoq1gsV/od0+q6ePbfuTyl4bo3BQ9ZHQN2Upw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2j95iuZlCEFaWRaEES+nsFFRHHgvudlOwgmRy1zfqIk81m67Ep+sWQNAIQtNCahiX Wk7OkDM40aphur5j636uscEEnij9ORNzHLqKW4PeWo56DbbFFLiNgd/6lZ/GX+eWZe S8pvEV0o6H+m0GF4XtW5gX+Cs58SLdfRlDyI7+RE= From: Eric Biggers To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, Alexei Starovoitov , Andrew Morton , Greg Kroah-Hartman , Jeff Vander Stoep , Jessica Yu , Kees Cook , Luis Chamberlain , NeilBrown , stable@vger.kernel.org Subject: [PATCH v2 2/4] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() Date: Thu, 12 Mar 2020 13:25:50 -0700 Message-Id: <20200312202552.241885-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200312202552.241885-1-ebiggers@kernel.org> References: <20200312202552.241885-1-ebiggers@kernel.org> MIME-Version: 1.0 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 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(). Cc: stable@vger.kernel.org Cc: Alexei Starovoitov Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: Jeff Vander Stoep Cc: Jessica Yu Cc: Kees Cook Cc: Luis Chamberlain Cc: NeilBrown Signed-off-by: Eric Biggers --- fs/filesystems.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/filesystems.c b/fs/filesystems.c index 77bf5f95362da..90b8d879fbaf3 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -272,7 +272,9 @@ struct file_system_type *get_fs_type(const char *name) 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)) { -- 2.25.1