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)
committerMichael Biebl <biebl@debian.org>
Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)
commitdfb61def00e2e6330fcaed80e43a4a84d4a46e6a
tree96281e502c2cb4251aec356b6e24f1fbfcedf916
parent5e6a90c0dffab695c46e2306c385e0284784aea3
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