Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp765456ybh; Wed, 18 Mar 2020 08:43:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZgoD1z8KxIHHn5KWHtQ7EcA5TRPTDfZwiwxKmT5kJaolfpDZU6/ghZVZ6a3pay/qYcaPt X-Received: by 2002:a05:6808:b2d:: with SMTP id t13mr3804872oij.107.1584546231444; Wed, 18 Mar 2020 08:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584546231; cv=none; d=google.com; s=arc-20160816; b=Eo/BXPlGwvQAuhS5pzuucYnGueGrS1lH6rDmmPysD0ct8HrzUZz0BXzPE781zsvLQG FXObf+fIhjuol4C+7jvAyqj9GexCWPvwR4fsZR/hFG0I4waQQDjhblepwVOh2PWOuzUs Uxy34N00qlS9MzCh/UHVw2QebD9PeAHdjVc1tMjooCi5SPMOQYsaJZIaXdeLg8VeWe6m Q+haLovMoMt32iHqwMgYoeNpvXWGj88jjAjCIXp3iQYBSnXhPvgv3m1QbwEBh/MYsT4j Pp2re0EvypJ8ywfDzQsvTSO0KLWgO/mdko13z/W2aAO0NHxy50XHLz+sBCi1W/KegFgW czhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u3XDC+OEfzaDIU9rpfO2B/nwJkSMU0cYy0llmspDTVc=; b=CrBoYbzPSQAqSF2F1cmvUJCdmEgimVPgxiYR6O/czGlbGIOyOE/G4xUnnBZE/00+bv oLpq4r+dbpNxdgqbJZIQD5tIuwojmh4kKO/eZws7LZAYC2bNOYRrmYLLR8F4uURNj/8G XLP581CGpssayejCRJ/JSeWBH4V7vA9ZHbQXIhFS7lu1kh1CZMpmoEprQnECCXKfGwfB mBPHax5jxCC3qW/N1fiWSsJ4bqAiY7cF45o3YJqcqn669zTgpZk9HsFn7C0TSCI2UEuG 6TQaE4ukxGvZ2wnlA6JWdvUmEujk3nO2z6bBW8Dggf9BRZiX3bi/g4f2u6wBVlgJLfvz lqFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ATXEubSq; 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 p25si2733914ota.143.2020.03.18.08.43.39; Wed, 18 Mar 2020 08:43: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=ATXEubSq; 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 S1727014AbgCRPnV (ORCPT + 99 others); Wed, 18 Mar 2020 11:43:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbgCRPnV (ORCPT ); Wed, 18 Mar 2020 11:43:21 -0400 Received: from linux-8ccs (p5B2812F9.dip0.t-ipconnect.de [91.40.18.249]) (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 6E68020767; Wed, 18 Mar 2020 15:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584546200; bh=iwK9ZIuWxFVtXKqXUS7isMl/puS748Mh/G1D0GM208U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ATXEubSqnLJ5zf8IFuO1isXZFmKsEpiFUZfSxQ5nQoKKboxQYN7cIcfVdhvfgIw6P +MJE06SKNCMx/NQle3Vfy7CgPW7giKLPCClA5P+/St5G8r4OiLVdJHxMoGijU7GMH9 VtxYe0MeSI37shj0sqFXTGe9c+HA2NbWkeHWet5Y= Date: Wed, 18 Mar 2020 16:43:15 +0100 From: Jessica Yu To: Eric Biggers Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexei Starovoitov , Andrew Morton , Greg Kroah-Hartman , Jeff Vander Stoep , Kees Cook , Luis Chamberlain , NeilBrown , stable@vger.kernel.org Subject: Re: [PATCH v3 2/5] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() Message-ID: <20200318154315.GB4144@linux-8ccs> References: <20200314213426.134866-1-ebiggers@kernel.org> <20200314213426.134866-3-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200314213426.134866-3-ebiggers@kernel.org> X-OS: Linux linux-8ccs 4.12.14-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Eric Biggers [14/03/20 14:34 -0700]: >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); Hm, what was the rationale for warning only once again? It might be useful for debugging issues to see each instance of request_module() failure (and with which fs). However, I don't have a concrete use case to support this argument, so: Reviewed-by: Jessica Yu