Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp994716ybh; Thu, 12 Mar 2020 15:07:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt5UsboqMYQxhL9zIeeLz3odO+rn6m5xJN4vtXpNVM6SNSn0yxJlv7CW0mhM0yamUMl1NWA X-Received: by 2002:a05:6830:1f54:: with SMTP id u20mr1914386oth.322.1584050854992; Thu, 12 Mar 2020 15:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584050854; cv=none; d=google.com; s=arc-20160816; b=jdWY2Mdai4/6HVA5RHsQ2vRnccocgBIKkaWG7w+6KNtGpL0xr7Y8SHqPa3pCP2NM3k jhVOmc2h1liXdU3YMeRP8SFOVgs35QU2Spv4vx56lxVNRrihID2dazMlzHHafGOVzYDw oDOWl8xdpHkTtfbI5S0951bzhu+vzO31AW/MuEntrMpZHq9qKSYpw1tbu7o3VVBMNxY8 SgWs4vJSORPM1cC2zjbv2Kp8TkCNpDGmoJMkLpnC1IWNaODsivw1PQxxiSmMP/hvzPOO 4oDiVzXBJ+xnhxNnXp8RpmiszuMPsv8c+qcO20gXakJMfhrOX80jgngDoQX83N+PtLjK +5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from; bh=doOMWEKzDiVuqmQZ/J6ZwbM0m24JEiL/aYv+xzy1eLQ=; b=sud0oGsB8GrInCwm7EqGwcimdxdCkSvEcjHOgQqiQypxZ+noiB64IaIsZvzNYwoEV8 hv8WKwVmg4DCX/Cutup0YclDNWNrZXGWQJ/Tx3wO1nU4zzL8KXGDhUMlXyBOXgeLIVW0 URz/eHwckI81PPccXY9SjOi6GVh9c3DGo1wG15Lnglii4NoXlDFkQ/mvn76GqRERT7gF lOo+h781B1BmHTQtmBwV4vhfGYGsvowq3cCPIp3eHDnvd71fJp2xhtZHvAXt9jhgPnqy 3xizBsPdUhW/+HsJy2sff0gG/8rXlLZj+p/uUPYrE8JCphYNTgZsKlTiRrR3rXT3ljyV 5dPw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s200si2197599oie.188.2020.03.12.15.07.22; Thu, 12 Mar 2020 15:07:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbgCLWG5 (ORCPT + 99 others); Thu, 12 Mar 2020 18:06:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:53628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgCLWG5 (ORCPT ); Thu, 12 Mar 2020 18:06:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C11B2AC44; Thu, 12 Mar 2020 22:06:54 +0000 (UTC) From: NeilBrown To: Eric Biggers , linux-kernel@vger.kernel.org Date: Fri, 13 Mar 2020 09:06:46 +1100 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: Re: [PATCH v2 2/4] fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() In-Reply-To: <20200312202552.241885-3-ebiggers@kernel.org> References: <20200312202552.241885-1-ebiggers@kernel.org> <20200312202552.241885-3-ebiggers@kernel.org> Message-ID: <87imj9teh5.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, Mar 12 2020, Eric Biggers wrote: > 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 =3D __get_fs_type(name, len); > if (!fs && (request_module("fs-%.*s", len, name) =3D=3D 0)) { > fs =3D __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); I strongly support the replacement of "WARN" by "pr_warn". I wonder if we really want the "once" now. Possibly using rate_limited would be justified, but I think that in general we should see a warning every time this event happens. Thanks, NeilBrown > } >=20=20 > if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { > --=20 > 2.25.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAl5qsnYACgkQOeye3VZi gbl3oBAAuV3LZM5xUEigsaeRtvVM9jGCrTQ5m9xsUxqV7SJ+fQfKx2sgHAZL5fD7 RfCoUBsYaOaeXL6XsSAb/ztSXlPAsADvhZxvNiz1DCdl+fkULVrG1k91iLKgNJuu jiByqqs+vZxeHp8BjOMDPts3VimUxKSoVIOX5wui7xC4ZWsYxY3Ca0g0E0VSj54f lRCs+80C0mkaQ+VwtHtamSgEFlIkqElqTTmnCVF98LrTI9X1GNSIN0jQz9fVjChS n/pyrFnJ8Py9FdbC7gZ2xNJe/01va8uKeCvE7Lqyfp3bHfTFJlNXul60rmoAWnM2 QSLuMqXHOLh4kdT52FHplr4ejmp6i+0uYzJbIPSMwY/KhWn2Z4b33rCchaxATU7P MhfIIhjAOOU+72iL93Xm5DMpHrHQAdsQH/hV4kpizhoqDL5kRS6apYmqJ0HGdfGf g7kqx+zrnNrkO2QdqJ2PDXJJCn4pZa6htMEESsdWkhltTPaQQ8c3BgjD5sywEFJP lkI5wQBSjzyiZRI6n94WB4PuHJzZLk1fQcRGjt22w+6U0p4dNvtIDo40L7kZK8dk uqSyat6aSpriad0xtXc8BTPhfctDRmiNyy5vRPfmac9lim3YQjYFECTUTNd5tTYx +Vzy+DNAA2tFWlVjV9xlwLVzPS9dMHDbTO41NE4GA0UQb9qXpYg= =siGd -----END PGP SIGNATURE----- --=-=-=--