aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2012-10-25 13:38:14 -0700
committerLinus Torvalds <[email protected]>2012-10-25 14:37:53 -0700
commit20f1de659b77364d55d4e7fad2ef657e7730323f (patch)
tree397b5a643fbcdf6cbb5bf69fb5ead4160db3716b /tools/perf/util/trace-event-scripting.c
parentfee0de7791f967c2c5f0d43eb7b7261761b45e64 (diff)
gen_init_cpio: avoid stack overflow when expanding
Fix possible overflow of the buffer used for expanding environment variables when building file list. In the extremely unlikely case of an attacker having control over the environment variables visible to gen_init_cpio, control over the contents of the file gen_init_cpio parses, and gen_init_cpio was built without compiler hardening, the attacker can gain arbitrary execution control via a stack buffer overflow. $ cat usr/crash.list file foo ${BIG}${BIG}${BIG}${BIG}${BIG}${BIG} 0755 0 0 $ BIG=$(perl -e 'print "A" x 4096;') ./usr/gen_init_cpio usr/crash.list *** buffer overflow detected ***: ./usr/gen_init_cpio terminated This also replaces the space-indenting with tabs. Patch based on existing fix extracted from grsecurity. Signed-off-by: Kees Cook <[email protected]> Cc: Michal Marek <[email protected]> Cc: Brad Spengler <[email protected]> Cc: PaX Team <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions