journald: do not store the iovec entry for process commandline on stack
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Dec 2018 17:38:39 +0000 (18:38 +0100)
committerMartin Pitt <mpitt@debian.org>
Sun, 27 Jan 2019 21:33:07 +0000 (21:33 +0000)
commit456008f1a605802798496aa2168d4445fce408db
tree0770d8224025622511ab5a66b23afdafc9d24e93
parentbc417c3795434a48e30ce183b97f5d272c129283
journald: do not store the iovec entry for process commandline on stack

This fixes a crash where we would read the commandline, whose length is under
control of the sending program, and then crash when trying to create a stack
allocation for it.

CVE-2018-16864
https://bugzilla.redhat.com/show_bug.cgi?id=1653855

The message actually doesn't get written to disk, because
journal_file_append_entry() returns -E2BIG.

(cherry picked from commit 084eeb865ca63887098e0945fb4e93c852b91b0f)
(cherry picked from commit cf56627fe5525132c8e09eb3e77bfc0556a2f04d)

Gbp-Pq: Name journald-do-not-store-the-iovec-entry-for-process-command.patch
src/basic/io-util.c
src/basic/io-util.h
src/coredump/coredump.c
src/journal/journald-server.c