Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1439813

[PATCH 0/2] binfmt_elf: fix calculations for bss padding

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject [PATCH 0/2] binfmt_elf: fix calculations for bss padding
Date 2016-07-08 23:50 +0200
Message-ID <rSLON-23d-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] binfmt_elf: fix calculations for bss padding Kees Cook <keescook@chromium.org> - 2016-07-08 23:50 +0200
  [PATCH 2/2] mm: refuse wrapped vm_brk requests Kees Cook <keescook@chromium.org> - 2016-07-08 23:50 +0200
    Re: [PATCH 2/2] mm: refuse wrapped vm_brk requests Oleg Nesterov <oleg@redhat.com> - 2016-07-11 14:30 +0200
      Re: [PATCH 2/2] mm: refuse wrapped vm_brk requests Kees Cook <keescook@chromium.org> - 2016-07-11 20:10 +0200
        Re: [PATCH 2/2] mm: refuse wrapped vm_brk requests Oleg Nesterov <oleg@redhat.com> - 2016-07-12 15:40 +0200
          Re: [PATCH 2/2] mm: refuse wrapped vm_brk requests Kees Cook <keescook@chromium.org> - 2016-07-12 19:20 +0200
            Re: [PATCH 2/2] mm: refuse wrapped vm_brk requests Oleg Nesterov <oleg@redhat.com> - 2016-07-13 19:10 +0200
  [PATCH 1/2] binfmt_elf: fix calculations for bss padding Kees Cook <keescook@chromium.org> - 2016-07-08 23:50 +0200
    Re: [PATCH 1/2] binfmt_elf: fix calculations for bss padding Kees Cook <keescook@chromium.org> - 2016-07-13 00:40 +0200

csiph-web