]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agoRename scripts/coverity.sh to tools/coverity.sh
Zbigniew Jędrzejewski-Szmek [Mon, 12 Mar 2018 14:39:21 +0000 (15:39 +0100)] 
Rename scripts/coverity.sh to tools/coverity.sh

There are only two files in tools/, I don't think we need a separate
directory for them.

6 years agofuzz-dhcp-server: fix name of options file
Zbigniew Jędrzejewski-Szmek [Sun, 11 Mar 2018 11:44:05 +0000 (12:44 +0100)] 
fuzz-dhcp-server: fix name of options file

6 years agofuzz-unit-file: add a dump of systemd.directives(7) as a corpus entry
Zbigniew Jędrzejewski-Szmek [Sun, 11 Mar 2018 11:36:19 +0000 (12:36 +0100)] 
fuzz-unit-file: add a dump of systemd.directives(7) as a corpus entry

$ ( echo service; man systemd.directives|grep =|grep -v -e --|sed 's/ //g'
  ) >> test/fuzz-corpus/unit-file/directives.service

6 years agofuzz: allow logging to be configured, disable in fuzz-unit-file
Zbigniew Jędrzejewski-Szmek [Sun, 11 Mar 2018 08:22:28 +0000 (09:22 +0100)] 
fuzz: allow logging to be configured, disable in fuzz-unit-file

fuzz-unit-file generated too much logs about invalid config lines. This just
slows things down and fills the logs. If necessary, it's better to rerun the
interesting cases with SYSTEMD_LOG_LEVEL=debug.

6 years agofuzz: skip bus error map in bus_error_name_to_errno()
Zbigniew Jędrzejewski-Szmek [Sat, 10 Mar 2018 16:41:41 +0000 (17:41 +0100)] 
fuzz: skip bus error map in bus_error_name_to_errno()

Fuzzing with AddressSanitizer reports an error here:
==11==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fe53f5497d8 at pc 0x7fe53ef055c9 bp 0x7ffd344e9380 sp 0x7ffd344e9378
READ of size 4 at 0x7fe53f5497d8 thread T0
SCARINESS: 27 (4-byte-read-global-buffer-overflow-far-from-bounds)
    #0 0x7fe53ef055c8 in bus_error_name_to_errno /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-error.c:118:24
    #1 0x7fe53ef0577b in bus_error_setfv /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-error.c:274:17
    #2 0x7fe53ef0595a in sd_bus_error_setf /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-error.c:284:21
    #3 0x561059 in manager_load_unit_prepare /work/build/../../src/systemd/src/core/manager.c
    #4 0x560680 in manager_load_unit /work/build/../../src/systemd/src/core/manager.c:1773:13
    #5 0x5d49a6 in unit_add_dependency_by_name /work/build/../../src/systemd/src/core/unit.c:2882:13
    #6 0x538996 in config_parse_unit_deps /work/build/../../src/systemd/src/core/load-fragment.c:152:21
    #7 0x6db771 in next_assignment /work/build/../../src/systemd/src/shared/conf-parser.c:155:32
    #8 0x6d697e in parse_line /work/build/../../src/systemd/src/shared/conf-parser.c:273:16
    #9 0x6d5c48 in config_parse /work/build/../../src/systemd/src/shared/conf-parser.c:390:21
    #10 0x535678 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-unit-file.c:41:16
    #11 0x73bd60 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:517:13
    #12 0x73a39f in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:442:3
    #13 0x73d9bc in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:650:19
    #14 0x73fa05 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:773:5
    #15 0x71f75d in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:754:6
    #16 0x71285c in main /src/libfuzzer/FuzzerMain.cpp:20:10
    #17 0x7fe53da0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #18 0x430e68 in _start (/out/fuzz-unit-file+0x430e68)

0x7fe53f5497d8 is located 8 bytes to the right of global variable 'bus_common_errors' defined in '../../src/systemd/src/libsystemd/sd-bus/bus-common-errors.c:28:51' (0x7fe53f549300) of size 1232
SUMMARY: AddressSanitizer: global-buffer-overflow /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-error.c:118:24 in bus_error_name_to_errno
Shadow bytes around the buggy address:
  0x0ffd27ea12a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea12b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea12c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea12d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea12e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ffd27ea12f0: 00 00 00 00 00 00 00 00 00 00 f9[f9]f9 f9 f9 f9
  0x0ffd27ea1300: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ffd27ea1310: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ffd27ea1320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea1330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd27ea1340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==11==ABORTING

but I think it's a false positive because of our low-level magic in how this
area is constructed.

6 years agoAdd fuzzer for unit file parser
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 21:02:02 +0000 (22:02 +0100)] 
Add fuzzer for unit file parser

6 years agoMake MANAGER_TEST_RUN_MINIMAL just allocate data structures
Zbigniew Jędrzejewski-Szmek [Sat, 10 Mar 2018 10:02:18 +0000 (11:02 +0100)] 
Make MANAGER_TEST_RUN_MINIMAL just allocate data structures

When running tests like test-unit-name, there is not point in setting
up the cgroup and signals and interacting with the environment. Similarly
when running fuzz testing of the parser.

Add new MANAGER_TEST_RUN_BASIC which takes the role of MANAGER_TEST_RUN_MINIMAL,
and redefine MANAGER_TEST_RUN_MINIMAL to just create the basic data structures.

6 years agoIntroduce _cleanup_(unit_freep)
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 20:34:28 +0000 (21:34 +0100)] 
Introduce _cleanup_(unit_freep)

6 years agoIntroduce _cleanup_(manager_freep)
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 20:55:55 +0000 (21:55 +0100)] 
Introduce _cleanup_(manager_freep)

6 years agoshared/sleep-config: fix unitialized variable and use STR_IN_SET (#8416)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Mar 2018 08:13:03 +0000 (09:13 +0100)] 
shared/sleep-config: fix unitialized variable and use STR_IN_SET (#8416)

6 years agoMerge pull request #8403 from evverx/test-mount-util
Zbigniew Jędrzejewski-Szmek [Sat, 10 Mar 2018 08:28:16 +0000 (09:28 +0100)] 
Merge pull request #8403 from evverx/test-mount-util

 tests: skip the rest of test_mnt_id after getting any error

6 years agocore: ignore errors from cg_create_and_attach() in test mode (#8401)
Michal Sekletar [Fri, 9 Mar 2018 22:30:32 +0000 (23:30 +0100)] 
core: ignore errors from cg_create_and_attach() in test mode (#8401)

Reproducer:

$ meson build && cd build
$ ninja
$ sudo useradd test
$ sudo su test
$ ./systemd --system --test
...
Failed to create /user.slice/user-1000.slice/session-6.scope/init.scope control group: Permission denied
Failed to allocate manager object: Permission denied

Above error message is caused by the fact that user test didn't have its
own session and we tried to set up init.scope already running as user
test in the directory owned by different user.

Let's try to setup cgroup hierarchy, but if that fails return error only
when not running in the test mode.

Fixes #8072

6 years agoMerge pull request #8412 from keszybz/meson-warning-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 19:12:37 +0000 (20:12 +0100)] 
Merge pull request #8412 from keszybz/meson-warning-fixes

Meson warning fixes

6 years agoMerge pull request #8415 from Werkov/fix-man
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 19:11:41 +0000 (20:11 +0100)] 
Merge pull request #8415 from Werkov/fix-man

Fix default values for KillUserProcesses and MemoryAccounting in documentation

6 years agoman: Correct value of default KillUserProcesses= 8415/head
Michal Koutný [Fri, 9 Mar 2018 15:40:41 +0000 (16:40 +0100)] 
man: Correct value of default KillUserProcesses=

6 years agoman: Unify values of boolean configuration values with sample config
Michal Koutný [Fri, 9 Mar 2018 17:27:13 +0000 (18:27 +0100)] 
man: Unify values of boolean configuration values with sample config

6 years agotests: skip g_dbus_message_new_from_blob under asan 8403/head
Evegeny Vereshchagin [Fri, 9 Mar 2018 14:51:45 +0000 (14:51 +0000)] 
tests: skip g_dbus_message_new_from_blob under asan

Some versions of asan report the following false positive
when strict_string_checks=1 is passed:

=================================================================
==3297==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f64e4090286 bp 0x7ffe46acd9a0 sp 0x7ffe46acd118 T0)
==3297==The signal is caused by a READ memory access.
==3297==Hint: address points to the zero page.
    #0 0x7f64e4090285 in __strlen_sse2 (/lib64/libc.so.6+0xaa285)
    #1 0x7f64e5a51e46  (/lib64/libasan.so.4+0x41e46)
    #2 0x7f64e4e5e3a0  (/lib64/libglib-2.0.so.0+0x383a0)
    #3 0x7f64e4e5e536 in g_dgettext (/lib64/libglib-2.0.so.0+0x38536)
    #4 0x7f64e48fac5f  (/lib64/libgio-2.0.so.0+0xc1c5f)
    #5 0x7f64e4c03978 in g_type_class_ref (/lib64/libgobject-2.0.so.0+0x30978)
    #6 0x7f64e4be9567 in g_object_new_with_properties (/lib64/libgobject-2.0.so.0+0x16567)
    #7 0x7f64e4be9fd0 in g_object_new (/lib64/libgobject-2.0.so.0+0x16fd0)
    #8 0x7f64e48fd43e in g_dbus_message_new_from_blob (/lib64/libgio-2.0.so.0+0xc443e)
    #9 0x564a6aa0de52 in main ../src/libsystemd/sd-bus/test-bus-marshal.c:228
    #10 0x7f64e4007009 in __libc_start_main (/lib64/libc.so.6+0x21009)
    #11 0x564a6aa0a569 in _start (/home/vagrant/systemd/build/test-bus-marshal+0x5569)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0xaa285) in __strlen_sse2
==3297==ABORTING

It's an external library and errors in external libraries are generally not very
useful for looking for internal bugs.

It would be better not to change the code and use standard suppression
techinques decribed at
https://clang.llvm.org/docs/AddressSanitizer.html#suppressing-reports-in-external-libraries,
but, unfortunaley, none of them seems to be able to suppress fatal errors in asan intself.

6 years agotests: make / private after creating a mount namespace
Evegeny Vereshchagin [Fri, 9 Mar 2018 01:10:42 +0000 (01:10 +0000)] 
tests: make / private after creating a mount namespace

so that the test never affects the root namespace.

6 years agotests: skip the rest of test_mnt_id after getting any error
Evegeny Vereshchagin [Fri, 9 Mar 2018 00:44:57 +0000 (00:44 +0000)] 
tests: skip the rest of test_mnt_id after getting any error

This mainly gets around a kernel bug making it possible to
have non-existent paths in /proc/self/mountinfo, but it should also
prevent flaky failures that can happen if something changes immediately
after or during reading /proc/self/mountinfo.

Closes https://github.com/systemd/systemd/issues/8286.

6 years agomeson: libmount is required for oss-fuzz builds now too 8412/head
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 13:58:47 +0000 (14:58 +0100)] 
meson: libmount is required for oss-fuzz builds now too

See https://github.com/google/oss-fuzz/issues/1191.

6 years agomeson: avoid warning about comparison of bool and string
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 13:21:08 +0000 (14:21 +0100)] 
meson: avoid warning about comparison of bool and string

meson.build:2907: WARNING: Trying to compare values of different types (bool, str) using ==.
The result of this is undefined and will become a hard error in a future Meson release.

6 years agomeson: use triple-quote delimition in one more place
Zbigniew Jędrzejewski-Szmek [Fri, 9 Mar 2018 13:15:39 +0000 (14:15 +0100)] 
meson: use triple-quote delimition in one more place

6 years agocore/socket: support binary inside chroot when looking for SELinux label (#8405)
Filipe Brandenburger [Fri, 9 Mar 2018 11:20:56 +0000 (03:20 -0800)] 
core/socket: support binary inside chroot when looking for SELinux label (#8405)

Otherwise having a .socket unit start a .service running a binary under
a chroot fails as the unit is unable to determine the SELinux label of
the binary.

6 years agocore/cgroup: accepts MemorySwapMax=0 (#8366)
Yu Watanabe [Fri, 9 Mar 2018 10:34:50 +0000 (19:34 +0900)] 
core/cgroup: accepts MemorySwapMax=0 (#8366)

Also, this moves two macros from dbus-util.h to dbus-cgroup.c,
as they are only used in dbus-cgroup.c.

Fixes #8363.

6 years agohwdb: add axis overrides for HP Pavilion 15 (#8404)
Peter Hutterer [Fri, 9 Mar 2018 09:54:28 +0000 (19:54 +1000)] 
hwdb: add axis overrides for HP Pavilion 15 (#8404)

https://bugzilla.redhat.com/show_bug.cgi?id=1551188

6 years agoMerge pull request #8372 from keszybz/two-cleanups
Lennart Poettering [Thu, 8 Mar 2018 22:23:43 +0000 (23:23 +0100)] 
Merge pull request #8372 from keszybz/two-cleanups

Two cleanups

6 years agocore: do not free heap-allocated strings (#8391)
Yu Watanabe [Thu, 8 Mar 2018 13:21:54 +0000 (22:21 +0900)] 
core: do not free heap-allocated strings (#8391)

Fixes #8387.

6 years agosd-bus: do not try to close already closed fd (#8392)
Yu Watanabe [Thu, 8 Mar 2018 13:19:35 +0000 (22:19 +0900)] 
sd-bus: do not try to close already closed fd (#8392)

Fixes #8376, which is introduced by 2b33ab0957f453a06b58e4bee482f2c2d4e100c1.

6 years agoIntroduce suspend-to-hibernate (#8274)
Mario Limonciello [Thu, 8 Mar 2018 13:17:33 +0000 (21:17 +0800)] 
Introduce suspend-to-hibernate (#8274)

Suspend to Hibernate is a new sleep method that invokes suspend
for a predefined period of time before automatically waking up
and hibernating the system.

It's similar to HybridSleep however there isn't a performance
impact on every suspend cycle.

It's intended to use with systems that may have a higher power
drain in their supported suspend states to prevent battery and
data loss over an extended suspend cycle.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
6 years agohwdb: add accelerometer mount matrix for Eve V (#8382)
Daniel Lin [Thu, 8 Mar 2018 07:44:11 +0000 (02:44 -0500)] 
hwdb: add accelerometer mount matrix for Eve V (#8382)

6 years agohwdb: add Dell Inspiron 3537 axis overrides (#8388)
Peter Hutterer [Thu, 8 Mar 2018 07:41:33 +0000 (17:41 +1000)] 
hwdb: add Dell Inspiron 3537 axis overrides (#8388)

PS/2 and RMI4 entries

https://bugs.freedesktop.org/show_bug.cgi?id=105370

6 years agoRevert "core: don't setup init.scope in test mode (#8380)" (#8390)
Yu Watanabe [Thu, 8 Mar 2018 06:29:19 +0000 (15:29 +0900)] 
Revert "core: don't setup init.scope in test mode (#8380)" (#8390)

This reverts commit a9e8ecf0374c675831208559ba37749a8f9719ef,
as it breaks test-path.

Fixes #8389.

6 years agotest-cgroup-util: bail out when running under mock (#8365)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 21:41:25 +0000 (22:41 +0100)] 
test-cgroup-util: bail out when running under mock (#8365)

The builds were failing in Fedora koji, where something strange is mounted
on /sys/fs/cgroup.

Also closes https://github.com/systemd/systemd/issues/8383.

6 years agocore: don't setup init.scope in test mode (#8380)
Michal Sekletar [Wed, 7 Mar 2018 15:41:41 +0000 (16:41 +0100)] 
core: don't setup init.scope in test mode (#8380)

Reproducer:

$ meson build && cd build
$ ninja
$ sudo useradd test
$ sudo su test
$ ./systemd --system --test
...
Failed to create /user.slice/user-1000.slice/session-6.scope/init.scope control group: Permission denied
Failed to allocate manager object: Permission denied

Above error message is caused by the fact that user test didn't have its
own session and we tried to set up init.scope already running as user
test in the directory owned by different user.

Let's skip setting up init.scope altogether since we won't be launching
processes anyway.

6 years agoMerge pull request #8378 from evverx/get-around-freopen
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 10:35:35 +0000 (11:35 +0100)] 
Merge pull request #8378 from evverx/get-around-freopen

tests: stop using `freopen` in `test-fileio`

6 years agoMerge pull request #8086 from hdante/sdboot-setmode-v2
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 09:41:44 +0000 (10:41 +0100)] 
Merge pull request #8086 from hdante/sdboot-setmode-v2

6 years agoMerge pull request #7817 from medhefgo/systemd-boot
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 09:14:41 +0000 (10:14 +0100)] 
Merge pull request #7817 from medhefgo/systemd-boot

systemd-boot improvements

6 years agosystemd-boot: fix off-by-one buffer overrun 7817/head
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 07:51:09 +0000 (08:51 +0100)] 
systemd-boot: fix off-by-one buffer overrun

We'd allocate a buffer of some size and then write zero to the byte one after.

6 years agosystemd-boot: reduce indentation in config_entry_add_linux()
Zbigniew Jędrzejewski-Szmek [Wed, 7 Mar 2018 07:55:04 +0000 (08:55 +0100)] 
systemd-boot: reduce indentation in config_entry_add_linux()

No functional change.

6 years agosystemd-boot: Try harder not to add ourselves to the list
Jan Janssen [Sat, 6 Jan 2018 18:21:48 +0000 (19:21 +0100)] 
systemd-boot: Try harder not to add ourselves to the list

We don't need to check if we are adding ourselves to the list
if we know that it's the windows or EFI shell loaders.

If we are adding the EFI default loader, additionally try to
see if we can find the systemd-boot magic string and skip
this entry if we do.

6 years agocore: drop unnecessary __useless_struct_to_allow_trailing_semicolon__ 8372/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 Mar 2018 08:34:03 +0000 (09:34 +0100)] 
core: drop unnecessary __useless_struct_to_allow_trailing_semicolon__

ISO C does not allow empty statements outside of functions, and gcc
will warn the trailing semicolons when compiling with -pedantic:

  warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]

But our code cannot compile with -pedantic anyway, at least because

  warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]

Without -pedatnic, clang and even old gcc (3.4) generate no warnings about
those semicolons, so let's just drop __useless_struct_to_allow_trailing_semicolon__.

6 years agobasic/cgroup-util: remove unused variable
Zbigniew Jędrzejewski-Szmek [Tue, 6 Mar 2018 08:37:11 +0000 (09:37 +0100)] 
basic/cgroup-util: remove unused variable

6 years agoNEWS: fix typos in v238 section (#8369)
Tomasz Torcz [Tue, 6 Mar 2018 08:35:47 +0000 (09:35 +0100)] 
NEWS: fix typos in v238 section (#8369)

6 years agorpm: add missing '-p <lua>' in trigger script (#8367)
Yu Watanabe [Tue, 6 Mar 2018 07:02:44 +0000 (16:02 +0900)] 
rpm: add missing '-p <lua>' in trigger script (#8367)

Follow-up for 32a00a9c097cf04ec2b0fcbf9b73eba188318424 (#8090).

6 years agotests: close a leftover file descriptor in `test-fileio` 8378/head
Evegeny Vereshchagin [Mon, 5 Mar 2018 22:05:46 +0000 (22:05 +0000)] 
tests: close a leftover file descriptor in `test-fileio`

This should make it a bit easier to search for real file descriptor leaks.

```
$ valgrind --leak-check=full --track-fds=yes ./build/test-fileio
...
==29457==
==29457== FILE DESCRIPTORS: 4 open at exit.
==29457== Open file descriptor 3: /tmp/test-systemd_writing_tmpfile.lyV5Rc
==29457==    at 0x4B9AD9E: open (open.c:43)
==29457==    by 0x4B19B24: __gen_tempname (tempname.c:261)
==29457==    by 0x4BA5CC3: mkostemp64 (mkostemp64.c:32)
==29457==    by 0x48F739B: mkostemp_safe (fileio.c:1206)
==29457==    by 0x10D968: test_writing_tmpfile (test-fileio.c:620)
==29457==    by 0x10E930: main (test-fileio.c:767)
==29457==
```

6 years agoMerge pull request #8362 from keszybz/release-238 v238
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 22:16:37 +0000 (23:16 +0100)] 
Merge pull request #8362 from keszybz/release-238

Release 238

6 years agoMerge pull request #8358 from fbuihuu/tmpfiles-dont-resolve-pathnames-when-traversing...
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 22:15:56 +0000 (23:15 +0100)] 
Merge pull request #8358 from fbuihuu/tmpfiles-dont-resolve-pathnames-when-traversing-recursively

Tmpfiles dont resolve pathnames when traversing recursively

6 years agotests: stop using `freopen` in `test-fileio`
Evegeny Vereshchagin [Mon, 5 Mar 2018 21:23:33 +0000 (21:23 +0000)] 
tests: stop using `freopen` in `test-fileio`

This helps get around a bug confusing `glibc` and making the test bail
out with the following error under `asan` on `x86`:

Fatal error: glibc detected an invalid stdio handle
Aborted (core dumped)

The bug has been reported in https://github.com/google/sanitizers/issues/778,
but it is unlikely to be fixed anytime soon.

6 years agotest: add tests for systemd-tmpfiles 8358/head
Franck Bui [Mon, 5 Mar 2018 11:32:18 +0000 (12:32 +0100)] 
test: add tests for systemd-tmpfiles

6 years agotest: fix setup_suse() to make it work with an already populated root
Franck Bui [Mon, 5 Mar 2018 18:02:25 +0000 (19:02 +0100)] 
test: fix setup_suse() to make it work with an already populated root

6 years agotmpfiles: don't resolve pathnames when traversing recursively through directory trees
Franck Bui [Fri, 2 Mar 2018 16:19:32 +0000 (17:19 +0100)] 
tmpfiles: don't resolve pathnames when traversing recursively through directory trees

Otherwise we can be fooled if one path component is replaced underneath us.

The patch achieves that by always operating at file descriptor level (by using
*at() helpers) and by making sure we do not any path resolution when traversing
direcotry trees.

However this is not always possible, for instance when listing the content of a
directory or some operations don't provide the *at() helpers or others (such as
fchmodat()) don't have the AT_EMPTY_PATH flag. In such cases we operate on
/proc/self/fd/%i pseudo-symlink instead, which works the same for all kinds of
objects and requires no checking of type beforehand.

Also O_PATH flag is used when opening file objects in order to prevent
undesired behaviors: device nodes from reacting, automounts from
triggering, etc...

Fixes: #7986
Fixes: CVE-2018-6954
6 years agotmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6
Franck Bui [Fri, 2 Mar 2018 15:25:56 +0000 (16:25 +0100)] 
tmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6

6 years agotmpfiles: make hardlink_vulnerable() argument constant
Franck Bui [Fri, 2 Mar 2018 15:13:07 +0000 (16:13 +0100)] 
tmpfiles: make hardlink_vulnerable() argument constant

6 years agoMerge pull request #8341 from yuwata/test-execute-ambient
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:45:28 +0000 (17:45 +0100)] 
Merge pull request #8341 from yuwata/test-execute-ambient

test-execute: check capabilities before runnig tests

6 years agoNEWS: bump version and add contributors 8362/head
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:13:38 +0000 (17:13 +0100)] 
NEWS: bump version and add contributors

6 years agomeson: bump so revision and systemd version in preparation for v238
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:12:48 +0000 (17:12 +0100)] 
meson: bump so revision and systemd version in preparation for v238

6 years agomailmap: one more person
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:08:01 +0000 (17:08 +0100)] 
mailmap: one more person

6 years agoMerge pull request #8345 from sourcejedi/logind_restart_is_sorely_lacking_in_testing
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:18:47 +0000 (17:18 +0100)] 
Merge pull request #8345 from sourcejedi/logind_restart_is_sorely_lacking_in_testing

login: fix for #8343

6 years agoMerge pull request #8354 from keszybz/new-NEWS
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 16:16:04 +0000 (17:16 +0100)] 
Merge pull request #8354 from keszybz/new-NEWS

NEWS for v238

6 years agomkosi: use locale that supports UTF-8, detect one that is available (#8340)
Filipe Brandenburger [Mon, 5 Mar 2018 16:03:52 +0000 (08:03 -0800)] 
mkosi: use locale that supports UTF-8, detect one that is available (#8340)

Using C.UTF-8 (as was done before #7244) breaks Arch Linux, but using
en_US.UTF-8 (after #7244) breaks Debian in our .mkosi/mkosi.debian.

So try to detect which one is available and works, first checking
whether we're already running under a valid UTF-8 locale, then trying
C.UTF-8 and finally en_US.UTF-8.

If we fail to find a valid UTF-8 locale, then fail early, instead of
letting the whole build complete only for Mesos to fail midway through
the `ninja test` step.

Tested on all of mkosi.fedora, mkosi.debian and mkosi.arch.

Fixes: #7238
6 years agoAdd accel matrix for iOTA 360 (#8342)
Marco Gulino [Mon, 5 Mar 2018 15:47:28 +0000 (15:47 +0000)] 
Add accel matrix for iOTA 360 (#8342)

6 years agoNEWS: update for v238 8354/head
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 09:25:17 +0000 (10:25 +0100)] 
NEWS: update for v238

6 years agoman: just use unicode for an mdash
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 08:31:17 +0000 (09:31 +0100)] 
man: just use unicode for an mdash

6 years agobasic/glob-util: do not use names with "_" prefix
Zbigniew Jędrzejewski-Szmek [Mon, 5 Mar 2018 08:04:39 +0000 (09:04 +0100)] 
basic/glob-util: do not use names with "_" prefix

Names starting with _ or __ are reserved by the standard, better to
avoid them.

6 years agocoredump: do not leak memory (#8352)
Yu Watanabe [Mon, 5 Mar 2018 07:39:52 +0000 (16:39 +0900)] 
coredump: do not leak memory (#8352)

Fixes #8351.

6 years agotest-execute: use CAP_CHOWN instead of CAP_NET_ADMIN 8341/head
Yu Watanabe [Sun, 4 Mar 2018 15:02:22 +0000 (00:02 +0900)] 
test-execute: use CAP_CHOWN instead of CAP_NET_ADMIN

CAP_NET_ADMIN is somtrimes dropped by container runtime.
This changes to use CAP_CHOWN instead of CAP_NET_ADMIN, as it is
less likely to be dropped.

6 years agotest-execute: check capabilities before running tests
Yu Watanabe [Sun, 4 Mar 2018 15:00:35 +0000 (00:00 +0900)] 
test-execute: check capabilities before running tests

Fixes #8193.

6 years agopo: Updated Indonesian translation (#8348)
Andika Triwidada [Sun, 4 Mar 2018 12:15:21 +0000 (19:15 +0700)] 
po: Updated Indonesian translation (#8348)

6 years agofixed 3 occurences of 'Failed top open' (#8349)
SjonHortensius [Sun, 4 Mar 2018 12:12:45 +0000 (13:12 +0100)] 
fixed 3 occurences of 'Failed top open' (#8349)

6 years agotest-execute: change log level from error to notice
Yu Watanabe [Sun, 4 Mar 2018 07:53:50 +0000 (16:53 +0900)] 
test-execute: change log level from error to notice

Skipping some tests due to the missing e.g., capsh binary
or kernel support, are not error.
This changes the log level for such messages.

6 years agotest-execute: rename tests for AmbientCapabilities=
Yu Watanabe [Sat, 3 Mar 2018 13:15:36 +0000 (22:15 +0900)] 
test-execute: rename tests for AmbientCapabilities=

The unit files for test-execute are named like
`exec-(setting-name-in-lower-character)-(optional-text).service`.
However, test units for AmbientCapabilities= are not following this.
So, let's rename them for the consistency.
This does not change anything in the functionality of the test.

6 years agohwdb: add axis range corrections for the Lenovo ThinkPad Edge 13 (02173BG) (#8253)
snorreflorre [Sun, 4 Mar 2018 07:18:46 +0000 (08:18 +0100)] 
hwdb: add axis range corrections for the Lenovo ThinkPad Edge 13 (02173BG) (#8253)

6 years agologin: remember that fds received from PID1 need to be removed eventually 8345/head
Alan Jenkins [Sat, 3 Mar 2018 18:44:39 +0000 (18:44 +0000)] 
login: remember that fds received from PID1 need to be removed eventually

Remember to set sd->pushed_fd when we receive an fd from PID1 on startup,
the same as we set it when we send an fd to PID1.

6 years agologin: fix FDNAME in call to sd_pid_notify_with_fds()
Alan Jenkins [Sat, 3 Mar 2018 18:37:50 +0000 (18:37 +0000)] 
login: fix FDNAME in call to sd_pid_notify_with_fds()

$ git grep FDNAME
logind-session-device.c: ... "FDNAME=session-", sd->session->id);
logind-session-device.c: ... "FDNAME=session", sd->session->id);

Oops.

Fixes #8343.  Or at least a more minimal reproducer.  Xorg still
dies when logind is restarted, but the Xorg message says this
is entirely deliberate.

(This could also be the reason I hit #8035, instead of the race
condition I originally suggested).

6 years agoupdate TODO
Lennart Poettering [Fri, 2 Mar 2018 15:25:27 +0000 (16:25 +0100)] 
update TODO

6 years agoMerge pull request #8314 from poettering/rearrange-stdio
Lennart Poettering [Fri, 2 Mar 2018 14:42:03 +0000 (15:42 +0100)] 
Merge pull request #8314 from poettering/rearrange-stdio

refactor how we rearrange fds for stdin/stdout/stderr

6 years agounits: use SuccessAction=reboot where appropriate (#8335)
Lennart Poettering [Fri, 2 Mar 2018 14:41:36 +0000 (15:41 +0100)] 
units: use SuccessAction=reboot where appropriate (#8335)

We should really use our own native concepts for rebooting.

6 years agoMerge pull request #8336 from poettering/coccinelle-reallocarray
Lennart Poettering [Fri, 2 Mar 2018 14:40:52 +0000 (15:40 +0100)] 
Merge pull request #8336 from poettering/coccinelle-reallocarray

reallocarray() coccinellization

6 years agoMerge pull request #8333 from keszybz/hwdb-update
Lennart Poettering [Fri, 2 Mar 2018 14:40:21 +0000 (15:40 +0100)] 
Merge pull request #8333 from keszybz/hwdb-update

Hwdb update

6 years agoMerge pull request #8337 from poettering/resolve-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 12:33:54 +0000 (13:33 +0100)] 
Merge pull request #8337 from poettering/resolve-fixes

various resolve-tool fixes

6 years agoman: there's no point in referenceing systemd.unit(5) from itself (#8338)
Lennart Poettering [Fri, 2 Mar 2018 12:33:30 +0000 (13:33 +0100)] 
man: there's no point in referenceing systemd.unit(5) from itself (#8338)

6 years agoMerge pull request #8323 from xyproto/ok_color
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 12:00:07 +0000 (13:00 +0100)] 
Merge pull request #8323 from xyproto/ok_color

Make the color of the status OK configurable at build-time

6 years agosysusers: support `u username -:300` style syntax (#8325)
Michael Vogt [Fri, 2 Mar 2018 11:56:44 +0000 (12:56 +0100)] 
sysusers: support `u username -:300` style syntax (#8325)

This PR implements the first part of RFE #8046. I.e. this allows to
write:
```
u username -:300
```
Where the uid is chosen automatically but the gid is fixed.

6 years agoMerge pull request #8332 from poettering/logind-open-if-needed
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:56:04 +0000 (12:56 +0100)] 
Merge pull request #8332 from poettering/logind-open-if-needed

logind device resume fix

6 years agomount-setup: change bpf mount mode to 0700 (#8334)
Lennart Poettering [Fri, 2 Mar 2018 11:55:24 +0000 (12:55 +0100)] 
mount-setup: change bpf mount mode to 0700 (#8334)

After discussing with the kernel folks, we agreed to default to 0700 for
this. Better safe than sorry.

6 years agoMerge pull request #8303 from yuwata/fix-8276
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:53:11 +0000 (12:53 +0100)] 
Merge pull request #8303 from yuwata/fix-8276

test: use synthesize_nobody() in test-execute

6 years agosystemctl: document telinit/init matching a bit (#8339)
Lennart Poettering [Fri, 2 Mar 2018 11:51:57 +0000 (12:51 +0100)] 
systemctl: document telinit/init matching a bit (#8339)

See: #8305

6 years agoresolved: debug log about resolv.conf lines we don't grok 8337/head
Lennart Poettering [Tue, 27 Feb 2018 16:47:00 +0000 (17:47 +0100)] 
resolved: debug log about resolv.conf lines we don't grok

6 years agoman: extend synopsys to recently added commands
Lennart Poettering [Wed, 28 Feb 2018 09:53:27 +0000 (10:53 +0100)] 
man: extend synopsys to recently added commands

6 years agoresolve-tool: propagate sensible errors from due to dns_name_is_valid() check failures
Lennart Poettering [Tue, 27 Feb 2018 16:46:00 +0000 (17:46 +0100)] 
resolve-tool: propagate sensible errors from due to dns_name_is_valid() check failures

6 years agoresolve-tool: trivial coding style improvements
Lennart Poettering [Tue, 27 Feb 2018 16:45:04 +0000 (17:45 +0100)] 
resolve-tool: trivial coding style improvements

6 years agococcinelle: similar to reallocarray() let's also systematically use malloc_multiply() 8336/head
Lennart Poettering [Tue, 27 Feb 2018 18:16:47 +0000 (19:16 +0100)] 
coccinelle: similar to reallocarray() let's also systematically use malloc_multiply()

6 years agococcinelle: add reallocarray() coccinelle script
Lennart Poettering [Tue, 27 Feb 2018 18:09:22 +0000 (19:09 +0100)] 
coccinelle: add reallocarray() coccinelle script

Let's systematically make use of reallocarray() whereever we invoke
realloc() with a product of two values.

6 years agoresolve-tool: use reallocarray() where appropriate
Lennart Poettering [Tue, 27 Feb 2018 16:45:30 +0000 (17:45 +0100)] 
resolve-tool: use reallocarray() where appropriate

6 years agohwdb: update 8333/head
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:12:04 +0000 (12:12 +0100)] 
hwdb: update

usb.ids are not updated, because linux-usb.org is down.

It seems that the updates are corrections and new entries, to major
removal of existing entries.

6 years agohwdb: add accelerometer mount matrix for Asus TP300LD (#8327)
futpib [Fri, 2 Mar 2018 11:11:28 +0000 (14:11 +0300)] 
hwdb: add accelerometer mount matrix for Asus TP300LD (#8327)

6 years agoMerge pull request #8237 from sourcejedi/timer_suspend
Lennart Poettering [Fri, 2 Mar 2018 11:11:06 +0000 (12:11 +0100)] 
Merge pull request #8237 from sourcejedi/timer_suspend

core: let OnCalendar= timer units expire during suspend (#8231)

6 years agohwdb: ignore whitespace in downloaded files
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:09:52 +0000 (12:09 +0100)] 
hwdb: ignore whitespace in downloaded files

6 years agotools/hwdb-update: allow downloads to fail
Zbigniew Jędrzejewski-Szmek [Fri, 2 Mar 2018 11:06:32 +0000 (12:06 +0100)] 
tools/hwdb-update: allow downloads to fail

sf.net is down, and linux-usb.org which is hosted there also fails.
That's not nice, but there's not we can do about it now.

6 years agologind: fix typo in comment 8332/head
Lennart Poettering [Fri, 2 Mar 2018 10:56:15 +0000 (11:56 +0100)] 
logind: fix typo in comment