core: when deserializing state always use read_line(…, LONG_LINE_MAX, …)
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 16:36:24 +0000 (18:36 +0200)
committerMichael Biebl <biebl@debian.org>
Tue, 20 Nov 2018 18:44:39 +0000 (18:44 +0000)
commit12c6394db7f6bc154038e1cac229c329f8780862
tree7bce08973397631c4f9ee4018a06c834cc0c4be4
parentc2655149c14bc20b42e087cfb50ef15c6b993e2a
core: when deserializing state always use read_line(…, LONG_LINE_MAX, …)

This should be much better than fgets(), as we can read substantially
longer lines and overly long lines result in proper errors.

Fixes a vulnerability discovered by Jann Horn at Google.

CVE-2018-15686
LP: #1796402
https://bugzilla.redhat.com/show_bug.cgi?id=1639071

(cherry picked from commit 8948b3415d762245ebf5e19d80b97d4d8cc208c1)
(cherry picked from commit 1a05ff4948d778280ec155a9abe69d3360bfddd9)

Gbp-Pq: Name core-when-deserializing-state-always-use-read_line-LONG_L.patch
src/core/job.c
src/core/manager.c
src/core/unit.c
src/core/unit.h