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>
Mon, 18 Feb 2019 13:54:04 +0000 (13:54 +0000)
commit8d8500efe9a3928aa325deaba5f57b4cec5a3234
treedebdd24487cd55fc33318a4cc68e04aa10bc4117
parent6f0cafbbffcbee8171119f75ed9acc198c6fc02e
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