public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] module: prevent warning when finit_module a 0 sized file
Date: Thu, 03 Jan 2013 17:14:44 -0500	[thread overview]
Message-ID: <50E602D4.8020604@oracle.com> (raw)
In-Reply-To: <877gnv5c9s.fsf@rustcorp.com.au>

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?


Thanks,
Sasha

  reply	other threads:[~2013-01-03 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 19:27 [PATCH] module: prevent warning when finit_module a 0 sized file Sasha Levin
2013-01-03  0:41 ` Rusty Russell
2013-01-03 22:14   ` Sasha Levin [this message]
2013-01-07  0:50     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50E602D4.8020604@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox