Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1150559ybh; Sat, 14 Mar 2020 19:26:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvyYQwe2HwET9wi5Wt7TOLbVJWY5OqGjVlfX7qIdVmAXWwBHMZs7Oow8IwtfIA/EyzmQMEa X-Received: by 2002:a9d:7991:: with SMTP id h17mr2649009otm.272.1584239211466; Sat, 14 Mar 2020 19:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584239211; cv=none; d=google.com; s=arc-20160816; b=EFUp3X9evaIbEe4pqhKMQ2+4+kKMbsvkMd/wXQcm9ZdlzX1xN+d7ZjG3CS4Ox2FogQ NfaMJYpGmi+fzRzqkclxQXAY3SvBU5vu4vpljcynt+4TXHGdk6lC98RCuseCwVo8BhVl YQm5az5fiiFJYcJ+z3F00pVAG3QX9V+NlonNnJvwA8Psn/TV5hlSlKaP52R1YcxSMgS4 f4J8WDxpHMi/+X6xOCY00a2Del/byOCLDuKS3ueoil+gGWJwtHHDwYrpqvQL3hcLB+j3 ytbiqwASbqougQH3WMQhJNVsNKjA03h6QvjVllrmB86WAtsT3It2Bzu4dwtGzIkJqQlx kQ/w== 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=ZsOjnYbfOkneReYGgNN7KDokss/cu86/CTmHxMro9VI=; b=qPmQ4g0PCfWifXDxAQ1xQ0vxenxOSj33Vm192UrK7ZxxNKAii3DuO9R2IY7sCWQ+7F h1OPApCbF7V1KlMdga6zWWk3x65lEtNeGkKLMd5KCkxX5FKIJfHgQj+2GoJgiL2HXWIV m+JaHN46zqdxzTiKD7EM5oG5GlZ3DyCJMG+HTXHjiyKRFHwftHrpV642I+TWW91c0wUg hKamj78RRbLdkme55mNHGqsaEa41c2qR/HNkgyxae+P8C79egHlXBjODJdjfaIO8DFU6 8PW1ZZc8aFJPVIaBGGWjjnpCfnCnXICx+LrOmIbFNIaW6Y1974qZNmdlncqMUQGqL9g9 Jo/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fWV8HZee; 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 b11si7123624oii.11.2020.03.14.19.26.39; Sat, 14 Mar 2020 19:26:51 -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=fWV8HZee; 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 S1728080AbgCOCY7 (ORCPT + 99 others); Sat, 14 Mar 2020 22:24:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbgCOCYN (ORCPT ); Sat, 14 Mar 2020 22:24:13 -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 2EC762082D; Sat, 14 Mar 2020 21:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584221808; bh=b6MuOpiS2xvMFw14CDhCFUowRT5zjT0d4DxRNwi5BuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWV8HZeeCoTyeew/nQtxVFj+FOH7LTGMjRB5BeNfEtvSl96zaOVgU807U3sp12O5F +qlQvfrBjX/Q0YX0KeZ1JRgtWQsLIl7xRBMCdd4bCv0ZLEmxwCgEVH6XH6WLShQXQc hyx3SNr+OfmXJYFcUN1Eil+iyH+Gj5MM5N3OT0hw= 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 v3 2/5] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() Date: Sat, 14 Mar 2020 14:34:23 -0700 Message-Id: <20200314213426.134866-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200314213426.134866-1-ebiggers@kernel.org> References: <20200314213426.134866-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(). Acked-by: Luis Chamberlain 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: 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