1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

63041 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
33d1a10c6d manager: fix error handling after failure to set up child
exec_child() is supposed to set *exit_status when returning failure.
Unfortunately, we didn't do that in two cases. The result would be:
- a bogus error message "Failed at step SUCCESS spawning foo: …",
- a bogus success exit status.

Bugs introduced in 390902012c5177b6b01bc634b2e9c704073d9e7d and
ad21e542b20f0fb292d1958d3a759bf3403522c2.

The code is reworked to add some asserts and not set exit_status in the caller
so that it's clearer (also to the compiler) that it needs to be set.

(cherry picked from commit 5fa01ac0369f0f225ab1e1f90f6b7058cc4deaaf)
(cherry picked from commit 063d67fe3255128da75d0e8ccd5afeb5c07699ff)
2023-09-08 00:45:00 +01:00
Warren
c03d5f1ddb p11kit: check the flags associated with the slot instead of flags associated with the token
The logic around checking PKCS11 tokens (used by systemd-cryptenroll) contains a bug.
The code is checking the flags field of a pkcs11 token_info structure against a set of flags defined for the pkcs11 slot_info structure. This PR changes the check so that the correct structure's flag field is being checked.
(Reference to the PKCS#11 spec:http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html, section CK_SLOT_INFO).

(cherry picked from commit 5007942477ecfb69702f542cb6770ea4b5bc1e57)
(cherry picked from commit 117fa69b71a8e39f663135c88f78a2412d87c4df)
2023-09-08 00:45:00 +01:00
Mike Yuan
1a77552257 sleep: clear EFI HibernateLocation if writing kernel config fails
Follow-up for f1f331a252d22c15f37d03524cce967664358c5c

(cherry picked from commit 031a399d87de5a47d395bb12b70e112c83b02c3f)
(cherry picked from commit f2fad1523986d9385a670a51f0332031dfe2f07e)
2023-09-08 00:45:00 +01:00
Rahil Bhimjiani
ef7eedb8c0 man: kernel-install(8) add uki.conf in FILES & add ukify(1) in SEE ALSO
Signed-off-by: Rahil Bhimjiani <rahil3108@gmail.com>
(cherry picked from commit f5263dd09e428df42c3d3b12f7e8ca95121ef3ee)
(cherry picked from commit 0baa4866d5f4b68d5d432ae88ddd73282bafcb07)
2023-09-08 00:45:00 +01:00
Michael A Cassaniti
b923225dec file-io: Fix copying sparse files
This change makes sure a data copy using copy_bytes() does not exceed the
max_bytes value when using COPY_HOLES and max_bytes stops before the next
data section.

(cherry picked from commit c2dfcbd48e780e49bfc11f1c34077f6c98891e40)
(cherry picked from commit 7bfe3c6215b03973016aa0931b16628253d7b985)
2023-09-08 00:45:00 +01:00
Franck Bui
c0a45a591c test-mountpoint-util: /root might be mounted
On openSUSE with BTRFS, /root has to be mounted as dedicated subvolume to avoid
restoring it when a rollback of the system happens.

(cherry picked from commit 487ae08b85048f86e72e86d6c601d4c558b6cb8a)
(cherry picked from commit 5c3fa0cfeea1907d2d71bb6dfadc94f661ce3e40)
2023-09-08 00:45:00 +01:00
Lennart Poettering
3a25191361 coredump: fix error path
We must go through finish, to undo the destruction of the final elements
of the iovw properly.

(cherry picked from commit 946dc7c635f050129896d1515c08a81504af2421)
(cherry picked from commit 10304c278755823605655b21c8dbb96f2b58b7e6)
2023-09-08 00:45:00 +01:00
Lennart Poettering
495f887e55 coredump: explicitly document that in order to process a coredump we have to write it to disk first
Prompted by: #28740

(cherry picked from commit 85ec1b6efadf3466bd1d265950f3d967a43cb1d0)
(cherry picked from commit a5d9940957bf7a3a90a9fc41b6a4d76cfe85aa59)
2023-09-08 00:45:00 +01:00
Lennart Poettering
bdc79b27ee man: let's tone down the recommendation to use Type=exec a bit
This is a follow-up for #28596.

I think the suggestion to use Type=exec uses too strong wording:
Type=exec has non-trivial drawbacks over Type=simple, and they deserve
to be mentioned.

Hence drop the <emphasis> and turn this around so that Type=exec is
*recommended*, but Type=simple is not expressly discouraged, because
there are plenty reasons to use it.

Add a brief discussion where Type=simple might be preferable.

Also, fix the outright unruth that Type=exec was the "simplest and
fastest", because it certainly is a lot, but not that.

(cherry picked from commit e5e900edcd3b245499379201072cbb69346e9798)
(cherry picked from commit 045ff3b47a2f6611e079cfdaf330366239b38c98)
2023-09-08 00:45:00 +01:00
Daan De Meyer
8a5b93fbe6 tree-wide: Fix -Wmaybe-uninitialized compilation warnings
(cherry picked from commit 7e48f3ba71614604e2b7fbb5bcfdb1c848600e89)
(cherry picked from commit 550cd149c1ffd7e8b7ce85d30fbcdb8a8b5ce394)
2023-09-08 00:45:00 +01:00
Maxim Mikityanskiy
883aab2e80 hwdb: Mute SW rfkill keys on MSI Wind U100
Kernel patch [1] fixed bugs in rfkill handling on MSI Wind U100. Now
that the HW rfkill reports the correct state, and the SW rfkill is
controllable from userspace, it's necessary to mute KEY_WLAN and
KEY_BLUETOOTH generated on HW rfkill state changes. Otherwise, the
userspace will react to these keys and toggle the SW rfkill as well,
which is not desired, because the user may end up with non-functional
radios if HW and SW rfkills are out of sync.

Blocking these keycodes doesn't impair user experience, because the
desktop environment can still react to HW rfkill events and act
accordingly (for example, show notifications).

While at it, use "unknown" instead of "reserved" to mute keys, to avoid
the "atkbd serio0: Unknown key pressed" flood in dmesg.

[1]: https://lore.kernel.org/all/20230721145423.161057-1-maxtram95@gmail.com/

(cherry picked from commit fa8216e20605ff42054ee316201a13ac6cdd4cd1)
(cherry picked from commit 208a21833b6953a2517a6c3f8f4849c6664b01be)
v253.8
2023-08-09 23:04:43 +01:00
Yu Watanabe
0563c5ddd9 veritysetup-generator: fix ordering of generated units
Fixes a bug introduced by 08b04ec7e72b7327b4803809732b1b8fce8dd069 and
953006dcb0a37a57aed0e762ff6289700e8689e8.

Fixes #28725.

(cherry picked from commit 685e0dd1924cce44327040b08a8980af2192bf59)
(cherry picked from commit 4bb0d3cf566eed5b11745d8c44bd788e611bbfb4)
2023-08-09 23:04:43 +01:00
Yu Watanabe
132229d87a sd-dhcp-server: propagate error on parsing DHCP packet
Otherwise, we silently ignore the received packet and that makes hard to
debug issue.

(cherry picked from commit 809da721f0167f88234e55a342e82023019e2341)
(cherry picked from commit 7483f75fa6c6487281d0f39633258902c62e8856)
2023-08-09 23:04:43 +01:00
Yu Watanabe
55a69c73df resolve: ignore nameserver= and domain= kernel command line options without value
Otherwise, manager_parse_dns_server_string_and_warn() or
manager_parse_search_domains_and_warn() will trigger assertion.

(cherry picked from commit 91acee9906e973365109b1b1d5e880ced9aeae65)
(cherry picked from commit 08c1aff48304eb2772c0cb2e6b9ad438608996eb)
2023-08-09 23:04:43 +01:00
mordner
6b1a3e05d0 man: fix typo in journalctl
(cherry picked from commit 653c90ec0e6f4d68b68938a20bd8cff492e7a666)
(cherry picked from commit b4b4caf09f2826266fbe70d0de1c6276f2670bd7)
2023-08-09 23:04:43 +01:00
Fabian Vogt
23b5306412 units/initrd-parse-etc.service: Conflict with emergency.target
If emergency.target is started while initrd-parse-etc.service/start is queued,
the initrd-parse-etc job did not get canceled. In parallel to the emergency
units, it eventually runs the service, which starts initrd-cleanup.service,
which in turn isolates initrd-switch-root.target. This stops the emergency
units and effectively starts the initrd boot process again, which likely
fails again like the initial attempt. The system is thus stuck in an endless
loop, never really reaching emergency.target.

With this conflict added, starting emergency.target automatically cancels
initrd-parse-etc.service/start, avoiding the loop.

(cherry picked from commit 327cd2d3db703555f8d572b4cd055fbe55e1068b)
(cherry picked from commit 72da03631ae175dfa852c2cdedcdd8e9215c1d4f)
2023-08-09 23:04:43 +01:00
Ronan Pigott
7ca3cae97b zsh: reintroduce pattern argument to uncached verbs
The systemctl completion previously made use of PREFIX as a pattern
argument to list-unit-files and list-units. This had the problem of
erroneously filtering the results that were stored in the cache, and
erroneously filtering results that might have been requested according
to the users configuration (e.g. _correct completer, certain
matcher-lists or tag-orders, etc.).

Unfortunately, the runtime of list-unit-files increases when no pattern
argument is provided, and systemctl show, used to filter those units,
can become unacceptably slow when provided with too many units to
describe.

Let's re-introduce the pattern argument to list-unit-files and
list-units where necessary in order to alleviate these bottlenecks
without poisining the cache. A 'use-pattern' style is introduced that
may be used to disable this behavior if it is undesired. We can still
expect that certain completions, like `systemctl start <TAB>` will be
slow, like before. To fix this we will need systemd to learn a more
efficient way of filtering the units than parsing systemctl show.

(cherry picked from commit 2cbda74862049be2003496c7d432341d53a0fdf9)
(cherry picked from commit dfc0445cb86e500732125da9f758092641a4c5a2)
2023-08-09 23:04:43 +01:00
Ronan Pigott
f664081482 zsh: use sys_really_all_units for non-template names
The systemctl invocations used for these completions match the ones used
for the _sys_really_all_units parameter, so we should really just use
the cached parameter rather than recomputing the result.

(cherry picked from commit c8e2cd79c155151bcdb983eedd24a6a77082c41b)
(cherry picked from commit 9814972198a11591bbb10dfb99e9d50a4bed055b)
2023-08-09 23:04:43 +01:00
Daan De Meyer
a99dfdca88 test-user-util: Drop tty check in gid_to_name() test
The tty user is not guaranteed to exist, so let's remove the dependency
from the test.

(cherry picked from commit a1fedc613fe90b9f1f253fd02a7a6575351a27cc)
(cherry picked from commit 865f0d6e76bcfbf880986b4b08c54baf9354e8a6)
2023-08-09 23:04:43 +01:00
Daan De Meyer
d0a3467f47 tmpfiles: Consider ENOPKG as information not available
We already handle the case where /etc/machine-id is empty. Let's make
sure we also handle the case where /etc/machine-id is "uninitialized".

(cherry picked from commit 5dd814d7cd88b9d58c7c5bd79fb27ee2b22e82a3)
(cherry picked from commit faaa0ee5e94dc4121954f1e63e7affdc97eee7e0)
2023-08-09 23:04:43 +01:00
Luca Boccassi
8f3ec30c46 portablectl: fix regression when using --force without extension parameters
c18f4eb9e96836a made it possible to use --force with various verbs, by
going through the newer D-Bus methods. Except it didn't, as it regressed
during PR review refactorings, and nobody noticed because there were no
tests for it. Fix it, and add tests.

Follow-up for c18f4eb9e96836a6a8285ec42fd8a34c8909f6d9

(cherry picked from commit bdfa3f3a5c6d16d56d432e7bc52be0c03a5ce6ad)
(cherry picked from commit 0f27d7b9f9cda1aa4e0d56cabd517e9a95026cf2)
2023-08-09 23:04:43 +01:00
Mike Yuan
4d79082c00 man/systemd.unit: DefaultTimeoutStartSec= -> DefaultDeviceTimeoutSec=
for device unit job timeouts

Follow-up for #24044

(cherry picked from commit 83d373d213cad0f67c85055bf342d36cef8ed8e6)
(cherry picked from commit a5e5d6d64e7f9fb1fa245c5cabddd2d1dcccfcaf)
2023-08-09 23:04:43 +01:00
Antonio Alvarez Feijoo
af6c953148 man/systemd-fsck@.service: clarify passno and noauto combination in /etc/fstab
Fixes #28657

(cherry picked from commit 000680a68dbdb07d77807868df0b4f978180e4cd)
(cherry picked from commit 9c1b5911af27193bf92780dc231fe523cecf4c24)
2023-08-09 23:04:43 +01:00
Khem Raj
af9df5f778 include missing sys/file.h for LOCK_EX
(cherry picked from commit ac8db36cbc26694ee94beecc8dca208ec4b5fd45)
(cherry picked from commit 6b03b53bcc140b36e0f0124946253ba9cda9a566)
2023-08-09 23:04:43 +01:00
Khem Raj
78186b11d0 test/test-sizeof: Include sys/timex.h for struct timex
Fixes

../git/src/test/test-sizeof.c:64:41: error: incomplete definition of type 'struct timex'
   64 |         check(typeof(((struct timex *)0)->freq), SIZEOF_TIMEX_MEMBER);
      |                      ~~~~~~~~~~~~~~~~~~~^

(cherry picked from commit e6456caf7676329abe861e9381f1957794baeabc)
(cherry picked from commit de249cefe9878ed4b6dfe33628462b1f44e8d513)
2023-08-09 23:04:43 +01:00
Jan Janssen
2d58262118 boot: Fix boot counting for XBOOTLDR entries
We were passing the dir handle for the ESP to
config_entry_bump_counters(), which will obviously fail if the entry
actually resides on the XBOOTLDR partition.

Fixes: #28637
(cherry picked from commit 66fd078ba89e90e8aeba6edac52d20456fc2cd5d)
(cherry picked from commit b44bd7d7a88a1ca7a03aebbf5d791f3f99789fb9)
2023-08-09 23:04:43 +01:00
Jan Janssen
4953edf2fb bless-boot: Actually return successfully
$ journalctl -u systemd-bless-boot.service
systemd[1]: Starting Mark the Current Boot Loader Entry as Good...
systemd-bless-boot[536]: Marked boot as 'good'. (Boot attempt counter is at 2.)
systemd-bless-boot[536]: Can't find boot counter source file for '/loader/entries/arch.conf': Device or resource busy
systemd[1]: Finished Mark the Current Boot Loader Entry as Good.

(cherry picked from commit 8f30a066ff48325c9197ae3b103cd446852b9f3d)
(cherry picked from commit ca38c7d81b909af2b615ef9a89251ce6ad25b977)
2023-08-09 23:04:43 +01:00
Yu Watanabe
2c2b89aede network-generator: make network file generated from ip=dhcp matches only physical interfaces
Otherwise, it also matches later created virtual devices, and that
breaks networks generated and managed by container management services,
like docker.

Closes #28626.

(cherry picked from commit c25aa6c8acc6d95eaacae7858a7057907d61a25e)
(cherry picked from commit d39bfd26d47793fc95aabfd9ff4f32e8d63d1021)
2023-08-09 23:04:43 +01:00
Khem Raj
322a7ad4c6 include sys/file.h for LOCK_EX
Fixes
| ../git/src/basic/user-util.c:708:30: error: use of undeclared identifier 'LOCK_EX'; did you mean 'LOCK_BSD'?
|   708 |         r = unposix_lock(fd, LOCK_EX);
|       |                              ^~~~~~~
|       |                              LOCK_BSD

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 213ddf2d0525535533a8d758b50b99fcbd31c17b)
(cherry picked from commit c12373dc4416e545f221d5b05eef1387a8e53372)
2023-08-09 23:04:43 +01:00
Franck Bui
8541307b23 test: install systemd-homed for openSUSE
This new sub-package has been recently introduced.

(cherry picked from commit 33ce0a899258ed8dfb4a234a9f67e678127d41f9)
(cherry picked from commit 65d5b3561c2692e947327e9a77d3b1b4d932c828)
2023-08-09 23:04:43 +01:00
Franck Bui
c65270ef5f test: console fonts are located in /usr/share on openSUSE
(cherry picked from commit ba0ff9fc0fa657024edd7a4a0aab01aa95b39ff5)
(cherry picked from commit ca0c8adf9d6d348cd59e12282e1effab4a39c5f3)
2023-08-09 23:04:43 +01:00
Yu Watanabe
fbfb9403e7 test: skip tests earlier when we do not have enough privileges
Hopefully fixes #28624.

(cherry picked from commit 46f0a4e7ac97b47c5718b718e3c6db4a8a8e78a0)
(cherry picked from commit f1df09a9fd4b22f09450465137e11e34104c8b2c)
2023-08-09 23:04:43 +01:00
Yu Watanabe
22bd243c80 udev-builtin-net_id: fix potential buffer overflow
(cherry picked from commit 5660e68d651545b43e13a51b068e64022637a6c6)
(cherry picked from commit a987b0f12133bcb5ab73000109468871bfbab3c2)
2023-08-09 23:04:43 +01:00
David Tardon
a4b275450d core: free the strings in the set in other places too
Follow-up for #28551.

(cherry picked from commit 1a572fd08ff4a01f77d3b8c8465a559971c77466)
(cherry picked from commit 5c47cc39296c26dfad69548f93e6e36c15551946)
2023-08-09 23:04:43 +01:00
Yu Watanabe
37833dc1de network/address: make Label= accept an empty string
We usually reset setting when an emptry string is specified.

(cherry picked from commit b8e898a681a7d8a663b766f8e44469bc910d20cc)
(cherry picked from commit 9087f924f9fec58e658aeb929a4d17b789c886ea)
2023-08-09 23:04:43 +01:00
Zbigniew Jędrzejewski-Szmek
9449449ef9 man/systemd.service: advise Type=exec instead of Type=simple
The descriptions of various options are reworked: first say what protocol
actually is, i.e. describe what type of notification the manager waits
for. Only after that describe various steps and things the service should
do. Also, apply some paragraph breaks.

Instead of recommending Type=simple, recommend Type=exec. Say explicitly that
Type=simple, Type=forking are not recommended. Type=simple ignores failure in a
way that doesn't make any sense except as a historical accident. We introduced
'exec' instead of changing 'simple' to keep backwards-compatiblity, but
'simple' is not very useful. 'forking' works, but is inefficient: correctly
programming the interface requires a lot of work, and at runtime, the
additional one or two forks are just a waste of CPU resources. Furthermore, we
now understand that because of COW traps, they may also increase memory
requirements. There is really no reason to use 'forking', except if it's
already implemented and the code cannot be changed to use 'notify'.

Also, remove the recommendations to use Type=simple to avoid delaying boot. In
most cases, if the service can support notifications about startup, those
should be done.

Overall, for new services, "notify", "notify-reload", and "dbus" are the
types that make sense.

(cherry picked from commit 377d3a31e638c834ba66edefa4cabc90318420fc)
(cherry picked from commit 3d9be9aa3171d2096ab4922630f4db0a548e570d)
2023-08-09 23:04:43 +01:00
Zbigniew Jędrzejewski-Szmek
d1198b7760 configure: update meson invocation
New meson says:
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

Inspired by https://github.com/systemd/systemd/issues/28482.

(cherry picked from commit 4f3c90acfee4f5bbd128bdc72008fa2f79d52cfd)
(cherry picked from commit ce856bb8c2f8d64504faababa8d046880bfa7165)
2023-08-09 23:04:43 +01:00
Frantisek Sumsal
b97ec52239 core: free the strings in the set as well during unit cleanup
Spotted while fuzzing #27890.

=================================================================
==908098==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4efe6d81f5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81f5) (BuildId: dc689b05ca2577037af24700212bb5cce1f91c8a)
    #1 0x7f4efb8e3ace in greedy_realloc ../src/basic/alloc-util.c:70
    #2 0x7f4efb93b713 in extract_first_word ../src/basic/extract-word.c:62
    #3 0x7f4efb970d50 in set_put_strsplit ../src/basic/hashmap.c:1902
    #4 0x7f4efd76c27e in exec_context_deserialize ../src/core/execute-serialize.c:3341
    #5 0x7f4efd778dcb in exec_deserialize ../src/core/execute-serialize.c:4122
    #6 0x4032c0 in LLVMFuzzerTestOneInput ../src/core/fuzz-execute-serialize.c:60
    #7 0x403c58 in main ../src/fuzz/fuzz-main.c:50
    #8 0x7f4efecccb49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #9 0x7f4efecccc0a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #10 0x402344 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-san/fuzz-execute-serialize+0x402344) (BuildId: 195f382cf1e39b9ba48d6dcf5a90f786d72837a8)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
Aborted (core dumped)

==911550==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x4df281 in strdup (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x4df281) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #1 0x7fe4ae2b38fc in _set_put_strndup_full /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/basic/hashmap.c:1868:21
    #2 0x7fe4b0bad897 in exec_context_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:3914:29
    #3 0x7fe4b0b80592 in exec_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:4109:13
    #4 0x531d0f in LLVMFuzzerTestOneInput /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/fuzz-execute-serialize.c:59:16
    #5 0x440594 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440594) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #6 0x43f9b9 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x43f9b9) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #7 0x440fd5 in fuzzer::Fuzzer::MutateAndTestOne() (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440fd5) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #8 0x441955 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x441955) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #9 0x42e151 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x42e151) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #10 0x45a916 in main (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x45a916) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #11 0x7fe4ac449b49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #12 0x7fe4ac449c0a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #13 0x422b74 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x422b74) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
SUMMARY: AddressSanitizer: 17 byte(s) leaked in 1 allocation(s).

(cherry picked from commit 9b412709f21a4868e1bc0bb3252a4d26e862633b)
(cherry picked from commit 7bd680bc62c3d071ae6b4b4a834f79b4eceff0d8)
2023-08-09 23:04:43 +01:00
Luca Boccassi
b7531639dc bus: add some minimal bounds check on signatures
CID#1491292
CID#1491291
CID#1491290
CID#1491289
CID#1491284
CID#1491281
CID#1491280
CID#1491278

(cherry picked from commit d80cc39558ec7e596d594d1aadc4df81262611f8)
(cherry picked from commit a518ea9ff1fe55c7bb5e4f391858a57d66b779d0)
2023-08-09 23:04:43 +01:00
наб
ca7787a9f2 find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8fd7bfe99cd652082076e85e1417e4e9 ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")
(cherry picked from commit f26c794308975a875a98faf22a6650d7134f17c1)
2023-07-20 10:57:54 +02:00
Dmitry V. Levin
f1c4da0414 test: fix use of ERRNO_IS_PRIVILEGE()
Given that ERRNO_IS_PRIVILEGE() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the arguments passed to ERRNO_IS_PRIVILEGE() are the values
returned by read_one_line_file() which can legitimately return positive
values without errno semantics, so fix this by moving ERRNO_IS_PRIVILEGE()
invocations to the branches where the return values are known to be negative.

(cherry picked from commit fce846e0ace95920155088a7e70dac914e437e68)
v253.7
2023-07-17 18:08:54 +02:00
Dmitry V. Levin
791dbff59b resolved: fix use of ERRNO_IS_DISCONNECT()
Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by manager_recv() which can legitimately return 1 without errno
semantics, so fix this by moving ERRNO_IS_DISCONNECT() invocation to the
branch where the return value is known to be negative.

(cherry picked from commit 0bdea17c0aa37c4cdf586c072a7b35f8d0598cc3)
2023-07-17 18:08:53 +02:00
Dmitry V. Levin
920568b7e2 sd-bus: fix use of ERRNO_IS_DISCONNECT()
Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by bus_socket_process_watch_bind(), bus_socket_process_opening(),
and bus_socket_process_authenticating() which can legitimately return
positive values without errno semantics, so fix this by moving the
ERRNO_IS_DISCONNECT() invocation to the branch where the return value
is known to be negative.

(cherry picked from commit bb228f0ebc9b691ee2a871bffbf949936568f3ea)
2023-07-17 18:08:52 +02:00
Dmitry V. Levin
ebce7284fd socket: fix use of ERRNO_IS_DISCONNECT()
Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by socket_acquire_peer() which can legitimately return 1
without errno semantics, so fix this by moving ERRNO_IS_DISCONNECT()
invocation to the branch where the return value is known to be negative.

(cherry picked from commit d5f8890bbf375075c7042b31ff6e79ad491df04c)
2023-07-17 18:08:51 +02:00
Dmitry V. Levin
24256d039f kbd-util: fix use of ERRNO_IS_RESOURCE()
Given that ERRNO_IS_RESOURCE() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_RESOURCE() is the value
returned by recurse_dir_at() which can legitimately return positive
values without errno semantics, so fix this by moving the ERRNO_IS_RESOURCE()
invocation to the branch where the return value is known to be negative.

(cherry picked from commit ed3745b51cd823d4a651e250050b2b674f055585)
2023-07-17 18:08:47 +02:00
Daan De Meyer
5d62126451 units: Add --graceful flag to pcrphase units
Some of the new units using systemd-pcrphase are missing the --graceful
flag which causes them to error if the tpm libraries are not installed.
Add --graceful just like in the other pcrphase units to make systemd-pcrphase
exit gracefully if the tpm libraries are missing.

(cherry picked from commit f2aaa14d37e4257dd2f1fdc66063dc08a66d7f8b)
2023-07-17 18:08:37 +02:00
David Tardon
d6b23dd062 pam_systemd_home: suppress LOG_DEBUG msgs if debugging is off
This is a "sequel" to commit 2675747f3cdd6f1e6236bbb2f79abfa53fb307f1 .

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2210770
(cherry picked from commit f71b55b51075e7ce42fa0ad4ae5569ba1aea6ee2)
2023-07-17 16:53:33 +02:00
Mike Yuan
d7bb1f570a journalctl: fix when --grep is used with --follow
Follow-up for #25147 (db4691961ca52759fe6645d0fddb659ee4299ac2)

--follow sets arg_lines to 10, which breaks
--grep as the latter implies --reverse.
So let's not set --reverse if --follow is used.

(cherry picked from commit c673fd52e048138a6786fb9114c1ddbf0057d6fb)

Should fix https://bugzilla.redhat.com/show_bug.cgi?id=2215304.
2023-07-17 16:49:42 +02:00
Zbigniew Jędrzejewski-Szmek
5b3affccde hwdb: update to d98037166929b87ed119a1560d398a9460113eb7
git restore -s origin/main hwdb.d/ test/hwdb.d test/hwdb-test.sh
2023-07-17 16:49:42 +02:00
Luca Boccassi
908463cafb sd-gpt: __mips__ is also defined when building __mips64
Follow-up for d75ec33ed2a1781a82f9e0d62a79244ecd1e1edc

(cherry picked from commit c26a01ac8be0a9ab2857cd2006d9f6705c77b9b3)
2023-07-17 16:49:42 +02:00