Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1137801ybh; Wed, 18 Mar 2020 15:54:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtrP54N07wfwvOUvTb0dAcORHMq0pcHTZY52x5GFMGs+UVqBTo2a+seAhoGHRIse0LfbQ/I X-Received: by 2002:a9d:6457:: with SMTP id m23mr6100540otl.162.1584572088315; Wed, 18 Mar 2020 15:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584572088; cv=none; d=google.com; s=arc-20160816; b=zeo0eU1lfb2BU9dAyqdG7jPRtIymO6ns9Mf7YJAUoVcLvNf7w0hiTfHFMbMK7UC39o qjGyFr3jonhR0JaJ9Y8Umm5TN28BWjok6zVhhSxQErbQA4abgas94JxCGCSd+cb11fVO r/AWgApgL6TcE00SD/SXiN8mXOjKucbTXqbGWHS71Q75Ic+ix/yVnZh6ypR2aLNlsHVP hT+LyhZ65fwcGnarifuGa/EE4n9hEsIaWLA6UAQ5HrxvQy4fto5zAShgDQpus0ur4Edd VOD/91wfOfdPLI8fpPX2FRVhR1l4CYrt0ID5ggR6ch4xcAiZFilqwYzoiOOvUpzqlPOJ Xbsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=G4SIHHv89zpvuSFC5+V3j3tDcZZGlepd+JilXzDNBT8=; b=ZlWSM9sVpVG8Q/FWc8ooP+NIUkODCdORjaFKsKhBx0Gukac0gCp1T2Plycc/Mu9GCV Nsk7DUo6ivvSZik6CZBULBSVaKRkDf5avGzCihnj2j2eO/Vf5p0cDk7fkp+wYqfgn+pe Ehfa/MPF8FLqXFTfu7P+31vpIotSrL5HTuNwV01bA+zrZ5t6AFYZalOErYxlXnNdNcKx kpBrOXLIQ1a7kY4w398StuaCfMe4bWBrJzyfo0/x3rWqHnwWyiF36IpWmqpEwbG8bWql pynv9ZoSh7XImxqUIgMFkaZqlf5Yg9+gaClGyg5GXQjdCTMYJ2ZkfEYCa0NXt2wIKnVv l1oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bDYdMKyb; 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 z107si170809otb.292.2020.03.18.15.54.34; Wed, 18 Mar 2020 15:54:48 -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=bDYdMKyb; 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 S1726858AbgCRWyS (ORCPT + 99 others); Wed, 18 Mar 2020 18:54:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbgCRWyS (ORCPT ); Wed, 18 Mar 2020 18:54:18 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (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 2A95820767; Wed, 18 Mar 2020 22:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584572057; bh=2npaGP9myWXWoLNaPv4jAYfc7RYFPXKtndA7b70voqE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bDYdMKyb9v7DCaGd0DcQ6ZvuzY0GEVpi+j5YTgMAp7NVLBpuQFxeoCxaRTmOAAhzi 4szIBzFegXbg9z3kHpzfTk0zNp2aw0G86W7Z4vGsWd6Tw9cHTdqpHzIbkKcItLqKlE jnE1dzcQni33XlgHrhOtYe03Cuib3Q6eJyC0sbk8= Date: Wed, 18 Mar 2020 15:54:15 -0700 From: Eric Biggers To: Jessica Yu 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: <20200318225415.GD2334@sol.localdomain> References: <20200314213426.134866-1-ebiggers@kernel.org> <20200314213426.134866-3-ebiggers@kernel.org> <20200318154315.GB4144@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200318154315.GB4144@linux-8ccs> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 04:43:15PM +0100, Jessica Yu wrote: > +++ 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 This was discussed on v2, see https://lkml.kernel.org/lkml/20200313010053.GS11244@42.do-not-panic.com/. If the warning triggers, then it indicates a broken modprobe program. Printing the warning multiple times wouldn't really add any new information. And in any case, it's printed once both before and after this patch. - Eric