summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Zbigniew Jędrzejewski-Szmek [Tue, 8 Jan 2019 21:56:50 +0000 (22:56 +0100)]
udevd: drop redundant call to sd_event_get_exit_code
sd_event_loop returns the same thing anyway.
(cherry picked from commit
44dcf454b604628bf451194482c97ce981596ce5)
(cherry picked from commit
1f6562d559bd11612b3f59b20fae4ed34d688dff)
Gbp-Pq: Name udevd-drop-redundant-call-to-sd_event_get_exit_code.patch
Zbigniew Jędrzejewski-Szmek [Wed, 9 Jan 2019 13:08:29 +0000 (14:08 +0100)]
logind: do not pass negative number to strerror
(cherry picked from commit
65641b3cdc12923320879bac6f071eb45a70e79c)
(cherry picked from commit
8f8f3191d33ca8583fe62a9e6268e2a914a7b2c0)
Gbp-Pq: Name logind-do-not-pass-negative-number-to-strerror.patch
Zbigniew Jędrzejewski-Szmek [Fri, 7 Dec 2018 09:48:10 +0000 (10:48 +0100)]
journal-remote: set a limit on the number of fields in a message
Existing use of E2BIG is replaced with ENOBUFS (entry too long), and E2BIG is
reused for the new error condition (too many fields).
This matches the change done for systemd-journald, hence forming the second
part of the fix for CVE-2018-16865
(https://bugzilla.redhat.com/show_bug.cgi?id=
1653861).
(cherry picked from commit
ef4d6abe7c7fab6cbff975b32e76b09feee56074)
(cherry picked from commit
1c9232336460d0f004156964df1478e4d3ddac97)
Gbp-Pq: Name journal-remote-set-a-limit-on-the-number-of-fields-in-a-m.patch
Zbigniew Jędrzejewski-Szmek [Fri, 7 Dec 2018 11:47:14 +0000 (12:47 +0100)]
journal-remote: verify entry length from header
Calling mhd_respond(), which ulimately calls MHD_queue_response() is
ineffective at point, becuase MHD_queue_response() immediately returns
MHD_NO signifying an error, because the connection is in state
MHD_CONNECTION_CONTINUE_SENT.
As Christian Grothoff kindly explained:
> You are likely calling MHD_queue_repsonse() too late: once you are
> receiving upload_data, HTTP forces you to process it all. At this time,
> MHD has already sent "100 continue" and cannot take it back (hence you
> get MHD_NO!).
>
> In your request handler, the first time when you are called for a
> connection (and when hence *upload_data_size == 0 and upload_data ==
> NULL) you must check the content-length header and react (with
> MHD_queue_response) based on this (to prevent MHD from automatically
> generating 100 continue).
If we ever encounter this kind of error, print a warning and immediately
abort the connection. (The alternative would be to keep reading the data,
but ignore it, and return an error after we get to the end of data.
That is possible, but of course puts additional load on both the
sender and reciever, and doesn't seem important enough just to return
a good error message.)
Note that sending of the error does not work (the connection is always aborted
when MHD_queue_response is used with MHD_RESPMEM_MUST_FREE, as in this case)
with libµhttpd 0.59, but works with 0.61:
https://src.fedoraproject.org/rpms/libmicrohttpd/pull-request/1
(cherry picked from commit
7fdb237f5473cb8fc2129e57e8a0039526dcb4fd)
(cherry picked from commit
c6d56141fad673a42b6b4eb186d2d217becca71c)
Gbp-Pq: Name journal-remote-verify-entry-length-from-header.patch
Zbigniew Jędrzejewski-Szmek [Fri, 7 Dec 2018 11:13:10 +0000 (12:13 +0100)]
µhttpd: use a cleanup function to call MHD_destroy_response
(cherry picked from commit
d101fb24eb1c58c97f2adce1f69f4b61a788933a)
(cherry picked from commit
03bf8a389ea1e9822a1b66f14b699661e88e0cb3)
Gbp-Pq: Name httpd-use-a-cleanup-function-to-call-MHD_destroy_response.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 21:52:53 +0000 (22:52 +0100)]
journald: lower the maximum entry size limit to ½ for non-sealed fds
We immediately read the whole contents into memory, making thigs much more
expensive. Sealed fds should be used instead since they are more efficient
on our side.
(cherry picked from commit
6670c9de196c8e2d5e84a8890cbb68f70c4db6e3)
(cherry picked from commit
f0ad5fe17fc6cee1f04f8f93899538ea2e96256c)
Gbp-Pq: Name journald-lower-the-maximum-entry-size-limit-to-for-non-se.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 21:50:39 +0000 (22:50 +0100)]
journald: when processing a native message, bail more quickly on overbig messages
We'd first parse all or most of the message, and only then consider if it
is not too large. Also, when encountering a single field over the limit,
we'd still process the preceding part of the message. Let's be stricter,
and check size limits early, and let's refuse the whole message if it fails
any of the size limits.
(cherry picked from commit
964ef920ea6735d39f856b05fd8ef451a09a6a1d)
(cherry picked from commit
c13facb835046af8ab8ebad2ec63d9e8c0909f26)
Gbp-Pq: Name journald-when-processing-a-native-message-bail-more-quick.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 21:45:02 +0000 (22:45 +0100)]
journald: set a limit on the number of fields (1k)
We allocate a iovec entry for each field, so with many short entries,
our memory usage and processing time can be large, even with a relatively
small message size. Let's refuse overly long entries.
CVE-2018-16865
https://bugzilla.redhat.com/show_bug.cgi?id=
1653861
What from I can see, the problem is not from an alloca, despite what the CVE
description says, but from the attack multiplication that comes from creating
many very small iovecs: (void* + size_t) for each three bytes of input message.
(cherry picked from commit
052c57f132f04a3cf4148f87561618da1a6908b4)
(cherry picked from commit
eaf1d6e1e6ec5023ffdc2801e2b671226e862774)
Gbp-Pq: Name journald-set-a-limit-on-the-number-of-fields-1k.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 20:34:24 +0000 (21:34 +0100)]
coredump: fix message when we fail to save a journald coredump
If creation of the message failed, we'd write a bogus entry:
systemd-coredump[1400]: Cannot store coredump of 416 (systemd-journal): No space left on device
systemd-coredump[1400]: MESSAGE=Process 416 (systemd-journal) of user 0 dumped core.
systemd-coredump[1400]: Coredump diverted to
(cherry picked from commit
f0136e09221364f931c3a3b715da4e4d3ee9f2ac)
(cherry picked from commit
3f11736ae9f336ddbc34ad395c9fe5c99139af39)
Gbp-Pq: Name coredump-fix-message-when-we-fail-to-save-a-journald-core.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 17:48:23 +0000 (18:48 +0100)]
basic/process-util: limit command line lengths to _SC_ARG_MAX
This affects systemd-journald and systemd-coredump.
Example entry:
$ journalctl -o export -n1 'MESSAGE=Something logged'
__CURSOR=s=
976542d120c649f494471be317829ef9;i=34e;b=
4871e4c474574ce4a462dfe3f1c37f06;m=
c7d0c37dd2;t=
57c4ac58f3b98;x=
67598e942bd23dc0
__REALTIME_TIMESTAMP=
1544035467475864
__MONOTONIC_TIMESTAMP=
858200964562
_BOOT_ID=
4871e4c474574ce4a462dfe3f1c37f06
PRIORITY=6
_UID=1000
_GID=1000
_CAP_EFFECTIVE=0
_SELINUX_CONTEXT=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
_AUDIT_SESSION=1
_AUDIT_LOGINUID=1000
_SYSTEMD_OWNER_UID=1000
_SYSTEMD_UNIT=user@1000.service
_SYSTEMD_SLICE=user-1000.slice
_SYSTEMD_USER_SLICE=-.slice
_SYSTEMD_INVOCATION_ID=
1c4a469986d448719cb0f9141a10810e
_MACHINE_ID=
08a5690a2eed47cf92ac0a5d2e3cf6b0
_HOSTNAME=krowka
_TRANSPORT=syslog
SYSLOG_FACILITY=17
SYSLOG_IDENTIFIER=syslog-caller
MESSAGE=Something logged
_COMM=poc
_EXE=/home/zbyszek/src/systemd-work3/poc
_SYSTEMD_CGROUP=/user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
_SYSTEMD_USER_UNIT=gnome-terminal-server.service
SYSLOG_PID=4108
SYSLOG_TIMESTAMP=Dec 5 19:44:27
_PID=4108
_CMDLINE=./poc AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA>
_SOURCE_REALTIME_TIMESTAMP=
1544035467475848
$ journalctl -o export -n1 'MESSAGE=Something logged' --output-fields=_CMDLINE|wc
6 2053
2097410
2MB might be hard for some clients to use meaningfully, but OTOH, it is
important to log the full commandline sometimes. For example, when the program
is crashing, the exact argument list is useful.
(cherry picked from commit
2d5d2e0cc5171c6795d2a485841474345d9e30ab)
(cherry picked from commit
bcada1eb2f148e0712716d6095bb3a96e8153ec5)
Gbp-Pq: Name basic-process-util-limit-command-line-lengths-to-_SC_ARG_.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 17:38:39 +0000 (18:38 +0100)]
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
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 16:53:50 +0000 (17:53 +0100)]
journald: remove unnecessary {}
(cherry picked from commit
bc2762a309132a34db1797d8b5792d5747a94484)
(cherry picked from commit
ccbb69e14ea9938c20ced03b4952fee0d22684b0)
Gbp-Pq: Name journald-remove-unnecessary.patch
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 16:33:15 +0000 (17:33 +0100)]
coredump: remove duplicate MESSAGE= prefix from message
systemd-coredump[9982]: MESSAGE=Process 771 (systemd-journal) of user 0 dumped core.
systemd-coredump[9982]: Coredump diverted to /var/lib/systemd/coredump/core...
log_dispatch() calls log_dispatch_internal() which calls write_to_journal()
which appends MESSAGE= on its own.
(cherry picked from commit
4f62556d71206ac814a020a954b397d4940e14c3)
(cherry picked from commit
9f564b3f45008c1a178a186f944ddc7485614cd2)
Gbp-Pq: Name coredump-remove-duplicate-MESSAGE-prefix-from-message.patch
Yu Watanabe [Tue, 8 Jan 2019 18:35:55 +0000 (03:35 +0900)]
core/mount: make mount_setup_existing_unit() not drop MOUNT_PROC_JUST_MOUNTED flag from units
This fixes a bug introduced by
ec88d1ea0591beccab97d9096fd3fd7b09bc823c.
Fixes #11362.
(cherry picked from commit
d253a45e1c147f5174265d71d7419da7bd52a88b)
(cherry picked from commit
27492fe33697c88b5452602604b0b28771bfd39f)
Gbp-Pq: Name core-mount-make-mount_setup_existing_unit-not-drop-MOUNT_.patch
Yu Watanabe [Tue, 8 Jan 2019 17:46:03 +0000 (02:46 +0900)]
udev-node: make link_find_prioritized() return negative value when nothing found
Fixes a bug introduced by
a2554acec652fc65c8ed0c6c1fede9ba8c3693b1.
Fixes RHBZ#
1662303.
(cherry picked from commit
82d9ac23fd5ab2befe2a95187640a8d38799dd64)
(cherry picked from commit
f665fe3e2e74548a2a236f3b7635227621aa568a)
Gbp-Pq: Name udev-node-make-link_find_prioritized-return-negative-valu.patch
Lennart Poettering [Fri, 4 Jan 2019 12:24:18 +0000 (13:24 +0100)]
json: handle NULL explicitly in json_variant_has_type()
(cherry picked from commit
f8c186c9ece5c1c0b89abf52f058efb0ed37e0cb)
(cherry picked from commit
388e534d24cac041bd00b48f27a84d6b31089c67)
Gbp-Pq: Name json-handle-NULL-explicitly-in-json_variant_has_type.patch
Zbigniew Jędrzejewski-Szmek [Sun, 6 Jan 2019 21:17:00 +0000 (22:17 +0100)]
udev: rework how we handle the return value from spawned programs
When running PROGRAM="...", we would log
systemd-udevd[447]: Failed to wait spawned command '...': Input/output error
no matter why the program actually failed, at error level.
The code wouldn't distinguish between an internal failure and a failure in the
program being called and run sd_event_exit(..., -EIO) on any kind of error. EIO
is rather misleading here, becuase it suggests a serious error.
on_spawn_sigchld is updated to set the return code to distinguish failure to
spawn, including the program being killed by a signal (a negative return value),
and the program failing (positive return value).
The logging levels are adjusted, so that for PROGRAM= calls, which are
essentially "if" statements, we only log at debug level (unless we get a
timeout or segfault or another unexpected error).
(cherry picked from commit
a75211421fc9366068e6d9446e8e567246c72feb)
(cherry picked from commit
5862f1730af205e2b95349b477aeed25b2f3e3b8)
Gbp-Pq: Name udev-rework-how-we-handle-the-return-value-from-spawned-p.patch
Zbigniew Jędrzejewski-Szmek [Fri, 4 Jan 2019 10:19:10 +0000 (11:19 +0100)]
Revert "pam_systemd: drop setting DBUS_SESSION_BUS_ADDRESS"
This reverts commit
2b2b7228bffef626fe8e9f131095995f3d50ee3b.
Fixes #11293.
Removing the environment variable causes problems, e.g. Xfce and Chromium and
... don't communicate with the running dbus instance. If they attempt to start their
own instance, things become even more confusing. Those packages could be fixed
one by one, but removing the variable right now is causing too many problems.
(cherry picked from commit
00efd4988b8e4a147f96337de32e54925640f0b7)
(cherry picked from commit
6c44e6c681e55f8291078b51c72cbfd81cc21a94)
Gbp-Pq: Name Revert-pam_systemd-drop-setting-DBUS_SESSION_BUS_ADDRESS.patch
Evgeny Vereshchagin [Sun, 23 Dec 2018 23:29:56 +0000 (00:29 +0100)]
journal: rely on _cleanup_free_ to free a temporary string used in client_context_read_cgroup
Closes https://github.com/systemd/systemd/issues/11253.
(cherry picked from commit
ef30f7cac18a810814ada7e6a68a31d48cc9fccd)
(cherry picked from commit
1789a12dbf74112992a478ac4cf2f13d8c286d15)
Gbp-Pq: Name journal-rely-on-_cleanup_free_-to-free-a-temporary-string.patch
Yu Watanabe [Sat, 22 Dec 2018 18:28:28 +0000 (03:28 +0900)]
test: add test for sending/receiving an invalid device
(cherry picked from commit
4fe0caadc85431118f2d8aea7570307cfc2aed27)
(cherry picked from commit
c2a11194c33de9bc7545a7c4df3fda5b90f02a50)
Gbp-Pq: Name test-add-test-for-sending-receiving-an-invalid-device.patch
Yu Watanabe [Sat, 22 Dec 2018 10:49:47 +0000 (19:49 +0900)]
Revert "udevd: configure a child process name for worker processes"
This reverts commit
49f3ee7e74c714f55aab395c080b1099fc17f7fd.
(cherry picked from commit
ff86c92e3043f71fc801cf687600a480ee8f6778)
(cherry picked from commit
77421020c9ab36c1e701901d7e72747ca98d3133)
Gbp-Pq: Name Revert-udevd-configure-a-child-process-name-for-worker-pr.patch
Yu Watanabe [Tue, 1 Jan 2019 19:00:14 +0000 (04:00 +0900)]
Revert "sd-device: ignore bind/unbind events for now"
This reverts commit
56c886dc7ed5b2bb0882ba85136f4070545bfc1b.
Fixes #11277 and #11299.
(cherry picked from commit
b261494128e60dd3168e0ea961606ec4f39c5739)
(cherry picked from commit
ff2145bfe5aac524c5870a295293b8e3cc74e27a)
Gbp-Pq: Name Revert-sd-device-ignore-bind-unbind-events-for-now.patch
Yu Watanabe [Sat, 22 Dec 2018 18:06:47 +0000 (03:06 +0900)]
sd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()
As devpath may not be set yet.
When debug logging is enabled, log_device_*() calls
sd_device_get_sysname(). So, we should not assume that devpath is always
set.
Fixes #11258.
(cherry picked from commit
18fee12a2d489378a2a9b647db0d0eb8c43f5362)
(cherry picked from commit
9ae73a6273461361eef7e83d48aadee111d6616e)
Gbp-Pq: Name sd-device-fix-segfault-when-error-occurs-in-device_new_fr.patch
Yu Watanabe [Tue, 25 Dec 2018 03:56:48 +0000 (12:56 +0900)]
libudev-util: make util_replace_whitespace() read only len characters
This effectively reverts
df8ba4fa0e8be1ff7899d08a4b6be0196c8405a0.
Fixes #11264.
(cherry picked from commit
577ab71c58d36bc8577d15f172a306c9c05cd2f4)
(cherry picked from commit
c3712308fc090116e388f395e4a8bb0bd8446ea6)
Gbp-Pq: Name libudev-util-make-util_replace_whitespace-read-only-len-c.patch
YunQiang Su [Tue, 25 Dec 2018 11:01:17 +0000 (19:01 +0800)]
Pass separate dev_t var to device_path_parse_major_minor
MIPS/O32's st_rdev member of struct stat is unsigned long, which
is 32bit, while dev_t is defined as 64bit, which make some problems
in device_path_parse_major_minor.
Don't pass st.st_rdev, st_mode to device_path_parse_major_minor,
while pass 2 seperate variables. The result of stat is alos copied
out into these 2 variables. Fixes: #11247
(cherry picked from commit
f5855697aa19fb92637e72ab02e4623abe77f288)
(cherry picked from commit
a0d4edf0e7fe6674c44258a73e0722494d659976)
Gbp-Pq: Name Pass-separate-dev_t-var-to-device_path_parse_major_minor.patch
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 21:49:53 +0000 (22:49 +0100)]
test-json: check absolute and relative difference in floating point test
The test fails under valgrind, so there was an exception for valgrind.
Unfortunately that check only works when valgrind-devel headers are
available during build. But it is possible to have just valgrind installed,
or simply install it after the build, and then "valgrind test-json" would
fail.
It also seems that even without valgrind, this fails on some arm32 CPUs.
Let's do the usual-style test for absolute and relative differences.
(cherry picked from commit
aa70783f55b369521b94e0985e84bbdaae16b174)
(cherry picked from commit
88938bf95b850849d075d7a6ebe37bb1d9780efe)
Gbp-Pq: Name test-json-check-absolute-and-relative-difference-in-float.patch
Alex Mayer [Wed, 2 Jan 2019 17:53:47 +0000 (12:53 -0500)]
Docs: Add Missing Space Between Words
(cherry picked from commit
8d7fac92f07cc662e51dcda7c9f3a322454895c7)
(cherry picked from commit
e60c80a908a2c8c6036e41d083134c9e095aa268)
Gbp-Pq: Name Docs-Add-Missing-Space-Between-Words.patch
Yu Watanabe [Sun, 30 Dec 2018 12:13:43 +0000 (21:13 +0900)]
ask-password-api: do not call ask_password_keyring() if keyname == NULL
Fixes #11295.
(cherry picked from commit
1f00998c8739ac6adc2b7623cc1e5a8f67d95d7d)
(cherry picked from commit
095a38313daf043413c863634378c8ea7e5f6a09)
Gbp-Pq: Name ask-password-api-do-not-call-ask_password_keyring-if-keyn.patch
Yu Watanabe [Tue, 25 Dec 2018 15:36:55 +0000 (00:36 +0900)]
udev-event: do not read stdout or stderr if the pipefd is not created
Fixes #11255.
(cherry picked from commit
adeb26c1affd09138bb96a9e25b795d146e64c97)
(cherry picked from commit
32a11a27b69031240beea38260d93e034ea33036)
Gbp-Pq: Name udev-event-do-not-read-stdout-or-stderr-if-the-pipefd-is-.patch
Yu Watanabe [Tue, 25 Dec 2018 04:10:18 +0000 (13:10 +0900)]
switch-root: fix error message
Fixes #11261.
(cherry picked from commit
a5c67ccc575e6ebf12710cb7df84f65a51c5dc58)
(cherry picked from commit
ebcd154e1df434865d2752efdccbc7737bb28029)
Gbp-Pq: Name switch-root-fix-error-message.patch
Evgeny Vereshchagin [Sun, 23 Dec 2018 14:01:03 +0000 (15:01 +0100)]
core: free lines after reading them
Closes https://github.com/systemd/systemd/issues/11251.
(cherry picked from commit
7334ade4a7e103b1a01d1c8fe1ea7c7a854a1c31)
(cherry picked from commit
5fa79ab2eb900fc58824060e3dcf9508276c9047)
Gbp-Pq: Name core-free-lines-after-reading-them.patch
rogerjames99 [Fri, 28 Dec 2018 06:34:43 +0000 (06:34 +0000)]
Do not start server if it is already runnning (#11245)
(cherry picked from commit
7da7340afdd4760fb2dd9d000105c324a77aff4b)
Gbp-Pq: Name Do-not-start-server-if-it-is-already-runnning-11245.patch
Michael Biebl [Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)]
systemd (240-4) unstable; urgency=medium
[ Benjamin Drung ]
* Fix shellcheck issues in initramfs-tools scripts
[ Michael Biebl ]
* Import patches from v240-stable branch (up to
f02b5472c6)
- Fixes a problem in logind closing the controlling terminal when using
startx. (Closes: #918927)
- Fixes various journald vulnerabilities via attacker controlled alloca.
(CVE-2018-16864, CVE-2018-16865, Closes: #918841, Closes: #918848)
* sd-device-monitor: Fix ordering of setting buffer size.
Fixes an issue with uevents not being processed properly during coldplug
stage and some kernel modules not being loaded via "udevadm trigger".
(Closes: #917607)
* meson: Stop setting -fPIE globally.
Setting -fPIE globally can lead to miscompilations on certain
architectures. Instead use the b_pie=true build option, which was
introduced in meson 0.49. Bump the Build-Depends accordingly.
(Closes: #909396)
[dgit import unpatched systemd 240-4]
Michael Biebl [Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)]
Import systemd_240-4.debian.tar.xz
[dgit import tarball systemd 240-4 systemd_240-4.debian.tar.xz]
Michael Biebl [Sat, 22 Dec 2018 15:01:43 +0000 (15:01 +0000)]
Import systemd_240.orig.tar.gz
[dgit import orig systemd_240.orig.tar.gz]