Re: [PATCH] module: report -EFAULT on bytes remaining

2012-09-13 Thread Rusty Russell
Dan Carpenter writes: > On Wed, Sep 12, 2012 at 08:06:16AM -0700, Kees Cook wrote: >> Caught by smatch: >> kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT >> instead of the bytes remaining? >> >> Clean up the copy_from_user() call to not report a positive value. >>

Re: [PATCH] module: report -EFAULT on bytes remaining

2012-09-13 Thread Rusty Russell
Dan Carpenter dan.carpen...@oracle.com writes: On Wed, Sep 12, 2012 at 08:06:16AM -0700, Kees Cook wrote: Caught by smatch: kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT instead of the bytes remaining? Clean up the copy_from_user() call to not report a positive

Re: [PATCH] module: report -EFAULT on bytes remaining

2012-09-12 Thread Dan Carpenter
On Wed, Sep 12, 2012 at 08:06:16AM -0700, Kees Cook wrote: > Caught by smatch: > kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT > instead of the bytes remaining? > > Clean up the copy_from_user() call to not report a positive value. > With this patch, init_module()

[PATCH] module: report -EFAULT on bytes remaining

2012-09-12 Thread Kees Cook
Caught by smatch: kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT instead of the bytes remaining? Clean up the copy_from_user() call to not report a positive value. With this patch, init_module() will report errors from copy_from_user (before it would always only report

[PATCH] module: report -EFAULT on bytes remaining

2012-09-12 Thread Kees Cook
Caught by smatch: kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT instead of the bytes remaining? Clean up the copy_from_user() call to not report a positive value. With this patch, init_module() will report errors from copy_from_user (before it would always only report

Re: [PATCH] module: report -EFAULT on bytes remaining

2012-09-12 Thread Dan Carpenter
On Wed, Sep 12, 2012 at 08:06:16AM -0700, Kees Cook wrote: Caught by smatch: kernel/module.c:2450 copy_module_from_user() warn: maybe return -EFAULT instead of the bytes remaining? Clean up the copy_from_user() call to not report a positive value. With this patch, init_module() will