lkml.org 
[lkml]   [2011]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86: Fix memory leak of init_vdso_vars()
On Thu, Jul 21, 2011 at 2:38 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Andrew Lutomirski <luto@mit.edu> wrote:
>
>> On Thu, Jul 21, 2011 at 1:08 PM, Andi Kleen <ak@linux.intel.com> wrote:
>> > On Thu, Jul 21, 2011 at 10:33:14AM -0400, Andy Lutomirski wrote:
>> >> From: Zhitong Wang <wzt.wzt@gmail.com>
>> >>
>> >> If init_vdso_vars ran out of memory (not very likely), then it would
>> >> leak a few pages as well.
>> >>
>> >> Also rename init_vdso_vars to just init_vdso, since initializing
>> >> vvars is just about the only thing this function doesn't do.
>> >
>> > Just add a GFP_PANIC, there's no way to recover from this.
>> > Your system will not work without a vdso.
>>
>> Ingo objected to this before, although I'm not convinved.  Calling
>> init_vdso_vars more than once will cause major problems (like
>> double-patching of alternatives).  If there's too little memory for
>> it to work, then presumably there's also too little memory to start
>> init.
>>
>>  (Also, I bet that no one ever audited whether the ELF loader works
>> right if the vDSO failed to load.)
>>
>> Ingo?
>
> This assumes that the system actually needs an ELF loader - if a
> static binary is booted via a init= boot parameter it might not be
> needed.

I actually meant the kernel's loaded. But I just looked and it appears correct.

But I think this whole thing is silly, because I can't see any good
reason that the vdso needs to allocate memory in the first place.
I'll send a patch.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-07-21 21:41    [W:0.058 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site