[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a8bqja3i.fsf@rustcorp.com.au>
Date: Wed, 21 Dec 2016 12:51:21 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: "Luis R. Rodriguez" <mcgrof@...nel.org>
Cc: Filipe Manana <fdmanana@...e.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
"linux-doc\@vger.kernel.org" <linux-doc@...r.kernel.org>,
rgoldwyn@...e.com, hare <hare@...e.com>,
Jonathan Corbet <corbet@....net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kselftest@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Aaron Tomlin <atomlin@...hat.com>, rwright@....com,
Heinrich Schuchardt <xypron.glpk@....de>,
Michal Marek <mmarek@...e.com>, martin.wilck@...e.com,
Jeff Mahoney <jeffm@...e.com>, Ingo Molnar <mingo@...hat.com>,
Petr Mladek <pmladek@...e.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>, shuah@...nel.org,
DSterba@...e.com, Kees Cook <keescook@...omium.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Miroslav Benes <mbenes@...e.cz>, NeilBrown <neilb@...e.com>,
"linux-kernel\@vger.kernel.o rg" <linux-kernel@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Jessica Yu <jeyu@...hat.com>,
Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [RFC 10/10] kmod: add a sanity check on module loading
"Luis R. Rodriguez" <mcgrof@...nel.org> writes:
> OK -- if userspace messes up again it may be a bit hard to prove
> unless we have a validation debug thing in place, would such a thing
> in debug form be reasonable ?
That makes perfect sense. Untested hack:
diff --git a/fs/filesystems.c b/fs/filesystems.c
index c5618db110be..e5c90e80c7d3 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -275,9 +275,10 @@ struct file_system_type *get_fs_type(const char *name)
int len = dot ? dot - name : strlen(name);
fs = __get_fs_type(name, len);
- if (!fs && (request_module("fs-%.*s", len, name) == 0))
+ 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 (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {
put_filesystem(fs);
fs = NULL;
Maybe a similar hack for try_then_request_module(), but many places seem
to open-code request_module() so it's not as trivial...
Cheers,
Rusty.
Powered by blists - more mailing lists