lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110721183820.GA381@elte.hu>
Date:	Thu, 21 Jul 2011 20:38:20 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Andrew Lutomirski <luto@....edu>
Cc:	Andi Kleen <ak@...ux.intel.com>, mingo@...hat.com,
	wzt <wzt.wzt@...il.com>, linux-kernel@...r.kernel.org,
	x86@...nel.org, tglx@...utronix.de, hpa@...or.com,
	Michal Hocko <mhocko@...e.cz>,
	Zhitong Wang <zhitong.wangzt@...baba-inc.com>
Subject: Re: [PATCH] x86: Fix memory leak of init_vdso_vars()


* Andrew Lutomirski <luto@....edu> wrote:

> On Thu, Jul 21, 2011 at 1:08 PM, Andi Kleen <ak@...ux.intel.com> wrote:
> > On Thu, Jul 21, 2011 at 10:33:14AM -0400, Andy Lutomirski wrote:
> >> From: Zhitong Wang <wzt.wzt@...il.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.

Memory failure injection code will also cause this to panic early 
during bootup spuriously.

Really, we should cleanly tear down what we built up and fail cleanly 
as well, no need to be sloppy since we already have the patch. That 
some other code down the boot chain might be sloppy is no excuse to 
be sloppy here.

Would be nice to stick a WARN_ON() into the oom branch though, as 
it's clearly an anomalous condition.

(btw., there's no GFP_PANIC, we never had any such flag for the page 
allocator.)

Thanks,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ