linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] binfmt_elf: fix calculations for bss padding
@ 2016-07-08 21:48 Kees Cook
  2016-07-08 21:48 ` [PATCH 1/2] " Kees Cook
  2016-07-08 21:48 ` [PATCH 2/2] mm: refuse wrapped vm_brk requests Kees Cook
  0 siblings, 2 replies; 9+ messages in thread
From: Kees Cook @ 2016-07-08 21:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kees Cook, Hector Marco-Gisbert, Ismael Ripoll Ripoll,
	Alexander Viro, Kirill A. Shutemov, Oleg Nesterov, Chen Gang,
	Michal Hocko, Konstantin Khlebnikov, Andrea Arcangeli,
	Andrey Ryabinin, linux-fsdevel, linux-mm, linux-kernel

This fixes a double-bug in ELF loading, as noticed by Hector
Marco-Gisbert. To quote his original email:


 The size of the bss section for some interpreters is not correctly
 calculated resulting in unnecessary calls to vm_brk() with enormous size
 values.

 The bug appears when loading some interpreters with a small bss size. Once
 the last loadable segment has been loaded, the bss section is zeroed up to
 the page boundary and the elf_bss variable is updated to this new page
 boundary.  Because of this update (alignment), the last_bss could be less
 than elf_bss and the subtraction "last_bss - elf_bss" value could overflow.
 ...
 [e.g.] The size value requested to the vm_brk() call (last_bss - elf_bss) is
 0xfffffffffffff938 and internally this size is page aligned in the do_brk()
 function resulting in a 0 length request.


This series takes a slightly different approach to fixing it and updates
vm_brk to refuse bad allocation sizes.

-Kees

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-13 17:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 21:48 [PATCH 0/2] binfmt_elf: fix calculations for bss padding Kees Cook
2016-07-08 21:48 ` [PATCH 1/2] " Kees Cook
2016-07-12 22:32   ` Kees Cook
2016-07-08 21:48 ` [PATCH 2/2] mm: refuse wrapped vm_brk requests Kees Cook
2016-07-11 12:28   ` Oleg Nesterov
2016-07-11 18:01     ` Kees Cook
2016-07-12 13:39       ` Oleg Nesterov
2016-07-12 17:15         ` Kees Cook
2016-07-13 17:00           ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).