Re: kmod: add a sanity check on module loading

2017-01-09 Thread Luis R. Rodriguez
On Fri, Jan 06, 2017 at 04:53:54PM -0500, Jessica Yu wrote: > +++ Luis R. Rodriguez [06/01/17 21:36 +0100]: > > On Tue, Jan 03, 2017 at 10:34:53AM +1030, Rusty Russell wrote: > > > "Luis R. Rodriguez" writes: > > > > Right, out of ~350 request_module() calls (not included try

Re: [RFC 10/10] kmod: add a sanity check on module loading

2017-01-09 Thread Luis R. Rodriguez
On Tue, Jan 10, 2017 at 05:17:22AM +1030, Rusty Russell wrote: > "Luis R. Rodriguez" writes: > > On Tue, Jan 03, 2017 at 10:34:53AM +1030, Rusty Russell wrote: > >> "Luis R. Rodriguez" writes: > >> > Right, out of ~350 request_module() calls (not included

Re: kmod: add a sanity check on module loading

2017-01-06 Thread Jessica Yu
+++ Luis R. Rodriguez [06/01/17 21:36 +0100]: On Tue, Jan 03, 2017 at 10:34:53AM +1030, Rusty Russell wrote: "Luis R. Rodriguez" writes: > Right, out of ~350 request_module() calls (not included try requests) > only ~46 check the return value. Hence a validation check, and

Re: kmod: add a sanity check on module loading

2017-01-06 Thread Jessica Yu
+++ Rusty Russell [03/01/17 10:34 +1030]: "Luis R. Rodriguez" writes: Maybe a similar hack for try_then_request_module(), but many places seem to open-code request_module() so it's not as trivial... Hi Luis, Jessica (who is the main module maintainer now), Back

Re: [RFC 10/10] kmod: add a sanity check on module loading

2017-01-06 Thread Luis R. Rodriguez
On Tue, Jan 03, 2017 at 10:34:53AM +1030, Rusty Russell wrote: > "Luis R. Rodriguez" writes: > > Right, out of ~350 request_module() calls (not included try requests) > > only ~46 check the return value. Hence a validation check, and come to > > think of it, *this* was the

Re: [RFC 10/10] kmod: add a sanity check on module loading

2016-12-21 Thread Luis R. Rodriguez
On Tue, Dec 20, 2016 at 8:21 PM, Rusty Russell wrote: > "Luis R. Rodriguez" 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

Re: [RFC 10/10] kmod: add a sanity check on module loading

2016-12-20 Thread Rusty Russell
"Luis R. Rodriguez" 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

Re: [RFC 10/10] kmod: add a sanity check on module loading

2016-12-19 Thread Rusty Russell
"Luis R. Rodriguez" writes: > On Dec 16, 2016 9:54 PM, "Rusty Russell" wrote: > > AFAICT the mistake here is that kmod is returning "done, OK" when the > > module it is trying to load is already loading (but not finished > > loading). That's the root

Re: [RFC 10/10] kmod: add a sanity check on module loading

2016-12-14 Thread Rusty Russell
"Luis R. Rodriguez" writes: > kmod has an optimization in place whereby if a some kernel code > uses request_module() on a module already loaded we never bother > userspace as the module already is loaded. This is not true for > get_fs_type() though as it uses aliases. Well,

[RFC 10/10] kmod: add a sanity check on module loading

2016-12-08 Thread Luis R. Rodriguez
kmod has an optimization in place whereby if a some kernel code uses request_module() on a module already loaded we never bother userspace as the module already is loaded. This is not true for get_fs_type() though as it uses aliases. Additionally kmod <= v19 was broken -- it returns 0 to modprobe