]> Git Repo - linux.git/commit - fs/binfmt_elf.c
fs/binfmt_elf.c: prevent a coredump with a large vm_map_count from Oopsing
authorDan Aloni <[email protected]>
Mon, 30 Sep 2013 20:45:02 +0000 (13:45 -0700)
committerLinus Torvalds <[email protected]>
Mon, 30 Sep 2013 21:31:01 +0000 (14:31 -0700)
commit72023656961b8c81a168a7a6762d589339d0d7ec
treedf391a913b5dfd194924a1d1172ba5eed0c14560
parent7393dc45f6ed5d3aba43b06d49eb3b15f1318906
fs/binfmt_elf.c: prevent a coredump with a large vm_map_count from Oopsing

A high setting of max_map_count, and a process core-dumping with a large
enough vm_map_count could result in an NT_FILE note not being written,
and the kernel crashing immediately later because it has assumed
otherwise.

Reproduction of the oops-causing bug described here:

    https://lkml.org/lkml/2013/8/30/50

Rge ussue originated in commit 2aa362c49c31 ("coredump: extend core dump
note section to contain file names of mapped file") from Oct 4, 2012.

This patch make that section optional in that case.  fill_files_note()
should signify the error, and also let the info struct in
elf_core_dump() be zero-initialized so that we can check for the
optionally written note.

[[email protected]: avoid abusing E2BIG, remove a couple of not-really-needed local variables]
[[email protected]: fix sparse warning]
Signed-off-by: Dan Aloni <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Reported-by: Martin MOKREJS <[email protected]>
Tested-by: Martin MOKREJS <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/binfmt_elf.c
This page took 0.06294 seconds and 4 git commands to generate.