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: <20160311124201.GK27701@dhcp22.suse.cz>
Date:	Fri, 11 Mar 2016 13:42:01 +0100
From:	Michal Hocko <mhocko@...nel.org>
To:	Vlastimil Babka <vbabka@...e.cz>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	Alex Deucher <alexander.deucher@....com>,
	Alex Thorlton <athorlton@....com>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Andy Lutomirski <luto@...capital.net>,
	Benjamin LaHaise <bcrl@...ck.org>,
	Christian König <christian.koenig@....com>,
	Daniel Vetter <daniel.vetter@...el.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	David Airlie <airlied@...ux.ie>,
	Davidlohr Bueso <dave@...olabs.net>,
	David Rientjes <rientjes@...gle.com>,
	"H . Peter Anvin" <hpa@...or.com>, Hugh Dickins <hughd@...gle.com>,
	Ingo Molnar <mingo@...nel.org>,
	Johannes Weiner <hannes@...xchg.org>,
	"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
	Konstantin Khlebnikov <koct9i@...il.com>,
	linux-arch@...r.kernel.org, Mel Gorman <mgorman@...e.de>,
	Oleg Nesterov <oleg@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Petr Cermak <petrcermak@...omium.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 04/18] mm, aout: handle vm_brk failures

On Fri 11-03-16 11:32:42, Vlastimil Babka wrote:
> On 02/29/2016 02:26 PM, Michal Hocko wrote:
> >From: Michal Hocko <mhocko@...e.com>
> >
> >vm_brk is allowed to fail but load_aout_binary simply ignores the error
> >and happily continues. I haven't noticed any problem from that in real
> >life but later patches will make the failure more likely because
> >vm_brk will become killable (resp. mmap_sem for write waiting will become
> >killable) so we should be more careful now.
> >
> >The error handling should be quite straightforward because there are
> >calls to vm_mmap which check the error properly already. The only
> >notable exception is set_brk which is called after beyond_if label.
> >But nothing indicates that we cannot move it above set_binfmt as the two
> >do not depend on each other and fail before we do set_binfmt and alter
> >reference counting.
> >
> >Cc: Thomas Gleixner <tglx@...utronix.de>
> >Cc: Ingo Molnar <mingo@...hat.com>
> >Cc: "H. Peter Anvin" <hpa@...or.com>
> >Cc: Alexander Viro <viro@...iv.linux.org.uk>
> >Signed-off-by: Michal Hocko <mhocko@...e.com>
> 
> Acked--by: Vlastimil Babka <vbabka@...e.cz>

thanks!
> 
> [...]
> 
> >@@ -378,7 +381,9 @@ static int load_aout_library(struct file *file)
> >  			       "N_TXTOFF is not page aligned. Please convert library: %pD\n",
> >  			       file);
> >  		}
> >-		vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
> >+		retval = vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
> >+		if (IS_ERR_VALUE(retval))
> >+			goto out;
> >  		
> 
> You could have removed the extra whitespace on the line above, which my vim
> so prominently highlights :)

Fixed

> 
> >  		read_code(file, start_addr, N_TXTOFF(ex),
> >  			  ex.a_text + ex.a_data);
> >

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ