lkml.org 
[lkml]   [2013]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] module: prevent warning when finit_module a 0 sized file
Date
Sasha Levin <sasha.levin@oracle.com> writes:
> On 01/02/2013 07:41 PM, Rusty Russell wrote:
>> Sasha Levin <sasha.levin@oracle.com> writes:
>>
>>> If we try to finit_module on a file sized 0 bytes vmalloc will
>>> scream and spit out a warning.
>>>
>>> Since modules have to be bigger than 0 bytes anyways we can just
>>> check that beforehand and avoid the warning.
>>
>> Applied, but I added the comment you somehow missed :)
>
> Thanks!
>
> I do have a somewhat related follow-up question:
>
> When init_module() goes through the module loading process, it will try to vmalloc()
> whatever size passed to it by the user, which may cause vmalloc() to scream and shout
> if the size passed from userspace is too big.
>
> Do you think that reading just the header and doing a quick elf_header_check() on
> it before trying to read the entire file would make sense here?

No. Root asked, we do. If modprobe wants to check the header, let it.

Cheers,
Rusty.


\
 
 \ /
  Last update: 2013-01-07 03:01    [W:0.043 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site