Luca Boccassi [Sat, 2 Dec 2023 02:05:27 +0000 (02:05 +0000)]
NEWS: finalize for v255-rc4
Luca Boccassi [Sat, 2 Dec 2023 02:04:24 +0000 (02:04 +0000)]
Merge pull request #30291 from keszybz/seccomp-unknown-syscall
Backwardscompatibly handle syscalls unknown to us or libseccomp
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 22:13:54 +0000 (23:13 +0100)]
core: turn on higher optimization level in seccomp
This mirrors what
d75615f398a0fbf986cf03924462863ca6ee2f9f did for nspawn.
It isn't really a fatal failure if we can't set that, so ignore it in libseccomp
cannot set the attribute.
line OP JT JF K
=================================
0000: 0x20 0x00 0x00 0x00000004 ld $data[4]
0001: 0x15 0x00 0xb7 0x40000003 jeq
1073741827 true:0002 false:0185
0002: 0x20 0x00 0x00 0x00000000 ld $data[0]
0003: 0x15 0xb5 0x00 0x00000000 jeq 0 true:0185 false:0004
0004: 0x15 0xb4 0x00 0x00000001 jeq 1 true:0185 false:0005
0005: 0x15 0xb3 0x00 0x00000002 jeq 2 true:0185 false:0006
0006: 0x15 0xb2 0x00 0x00000003 jeq 3 true:0185 false:0007
0007: 0x15 0xb1 0x00 0x00000004 jeq 4 true:0185 false:0008
0008: 0x15 0xb0 0x00 0x00000005 jeq 5 true:0185 false:0009
0009: 0x15 0xaf 0x00 0x00000006 jeq 6 true:0185 false:0010
...
0438: 0x15 0x03 0x00 0x000001be jeq 446 true:0442 false:0439
0439: 0x15 0x02 0x00 0x000001bf jeq 447 true:0442 false:0440
0440: 0x15 0x01 0x00 0x000001c0 jeq 448 true:0442 false:0441
0441: 0x06 0x00 0x00 0x00050026 ret ERRNO(38)
0442: 0x06 0x00 0x00 0x7fff0000 ret ALLOW
line OP JT JF K
=================================
0000: 0x20 0x00 0x00 0x00000004 ld $data[4]
0001: 0x15 0x00 0x27 0x40000003 jeq
1073741827 true:0002 false:0041
0002: 0x20 0x00 0x00 0x00000000 ld $data[0]
0003: 0x25 0x01 0x00 0x000000b5 jgt 181 true:0005 false:0004
0004: 0x05 0x00 0x00 0x00000143 jmp 0328
0005: 0x25 0x00 0xa1 0x00000139 jgt 313 true:0006 false:0167
0006: 0x25 0x00 0x51 0x00000179 jgt 377 true:0007 false:0088
0007: 0x25 0x00 0x29 0x000001a0 jgt 416 true:0008 false:0049
0008: 0x25 0x00 0x13 0x000001b0 jgt 432 true:0009 false:0028
0009: 0x25 0x00 0x09 0x000001b8 jgt 440 true:0010 false:0019
...
0551: 0x15 0x03 0x00 0x00000002 jeq 2 true:0555 false:0552
0552: 0x15 0x02 0x01 0x00000001 jeq 1 true:0555 false:0554
0553: 0x15 0x01 0x00 0x00000000 jeq 0 true:0555 false:0554
0554: 0x06 0x00 0x00 0x00050026 ret ERRNO(38)
0555: 0x06 0x00 0x00 0x7fff0000 ret ALLOW
The program is longer but hopefully faster because of the binary search.
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 18:04:27 +0000 (19:04 +0100)]
shared/seccomp-util: use the same error message for the same condition
We were calling seccomp_syscall_resolve_name three times and using a
slightly different error message in each of the cases.
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 18:03:23 +0000 (19:03 +0100)]
core: when applying syscall filters, use ENOSYS for unknown calls
glibc starting using fchmodat2 to implement fchmod with flags [1], but
current version of libseccomp does not support fchmodat2 [2]. This is
causing problems with programs sandboxed by systemd. libseccomp needs to know
a syscall to be able to set any kind of filter for it, so for syscalls unknown
by libseccomp we would always do the default action, i.e. either return the
errno set by SystemCallErrorNumber or send a fatal signal. For glibc to ignore
the unknown syscall and gracefully fall back to the older implementation,
we need to return ENOSYS. In particular, tar now fails with the default
SystemCallFilter="@system-service" sandbox [3].
This is of course a wider problem: any time the kernel gains new syscalls,
before libseccomp and systemd have caught up, we'd behave incorrectly. Let's
do the same as we already were doing in nspawn since
3573e032f26724949e86626eace058d006b8bf70, and do the "default action" only
for syscalls which are known by us and libseccomp, and return ENOSYS for
anything else. This means that users can start using a sandbox with the new
syscalls only after libseccomp and systemd have been updated, but before that
happens they behaviour that is backwards-compatible.
[1] https://github.com/bminor/glibc/commit/
65341f7bbea824d2ff9d37db15d8be162df42bd3
[2] https://github.com/seccomp/libseccomp/issues/406
[2] https://github.com/systemd/systemd/issues/30250
Fixes https://github.com/systemd/systemd/issues/30250.
In seccomp_restrict_sxid() there's a chunk conditionalized with
'#if defined(__SNR_fchmodat2)'. We need to kep that because seccomp_restrict_sxid()
seccomp_restrict_suid_sgid() uses SCMP_ACT_ALLOW as the default action.
Mike Yuan [Fri, 1 Dec 2023 19:06:16 +0000 (03:06 +0800)]
core/cgroup: for non-cached attrs, don't return ENODATA blindly
Follow-up for
f17b07f4d72238da95312920dcc2ad076568cba3
Hope I won't break this thing again...
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 00:08:45 +0000 (01:08 +0100)]
Merge pull request #30294 from bluca/news
hwdb and NEWS updates
Neil Wilson [Fri, 1 Dec 2023 16:29:32 +0000 (16:29 +0000)]
systemd-homed.service.in: add quotactl to SystemCallFilter
Standard directories make a call to the quotactl system call to enforce disk size limits.
Fixes #30287
Luca Boccassi [Fri, 1 Dec 2023 22:07:08 +0000 (22:07 +0000)]
hwdb: update
Luca Boccassi [Fri, 1 Dec 2023 22:05:08 +0000 (22:05 +0000)]
NEWS: update contributors list
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 18:54:18 +0000 (19:54 +0100)]
Merge pull request #30268 from yuwata/network-fix-too-many-waiting-replies
network: fix issue caused by too many waiting replies
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 14:53:06 +0000 (15:53 +0100)]
core: fix comment
Дамјан Георгиевски [Fri, 1 Dec 2023 10:46:36 +0000 (11:46 +0100)]
fix: prefix of dmesg pstore files
A change in the kernel[1] renamed the prefix of the pstore files from
`dmesg-efi-` to `dmesg-efi_pstore-`.
[1]
https://git.kernel.org/linus/
893c5f1de620
Neil Wilson [Fri, 1 Dec 2023 16:32:18 +0000 (16:32 +0000)]
homework-quota.c: correct error message in home_update_quota_btrfs
Fixes #30286
dependabot[bot] [Fri, 1 Dec 2023 10:01:04 +0000 (10:01 +0000)]
build(deps): bump meson from 1.2.3 to 1.3.0 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.2.3...1.3.0)
---
updated-dependencies:
- dependency-name: meson
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Fri, 1 Dec 2023 09:04:01 +0000 (09:04 +0000)]
build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/
aa647ec4466543e8555c2c3b648124a9813cee44...
91e2582e40236f831458392d905578d680baa138)
---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Fri, 1 Dec 2023 09:03:54 +0000 (09:03 +0000)]
build(deps): bump redhat-plumbers-in-action/devel-freezer
Bumps [redhat-plumbers-in-action/devel-freezer](https://github.com/redhat-plumbers-in-action/devel-freezer) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/redhat-plumbers-in-action/devel-freezer/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/devel-freezer/compare/
13b6551f19ade74ca79be4cab06b815a4ffffa64...
67aec4a153bd9fca5322e1c4dd4d7c419fb36362)
---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/devel-freezer
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Fri, 1 Dec 2023 09:03:48 +0000 (09:03 +0000)]
build(deps): bump actions/github-script from 6.4.1 to 7.0.1
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.4.1 to 7.0.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/
d7906e4ad0b1822421a7e6a35d5ca353c962f410...
60a0d83039c74a4aee543508d2ffcb1c3799cdea)
---
updated-dependencies:
- dependency-name: actions/github-script
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Fri, 1 Dec 2023 09:03:50 +0000 (09:03 +0000)]
build(deps): bump github/codeql-action from 2.21.9 to 2.22.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.9 to 2.22.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
ddccb873888234080b77e9bc2d4764d5ccaaccf9...
407ffafae6a767df3e0230c3df91b6443ae8df75)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Franck Bui [Fri, 1 Dec 2023 07:44:53 +0000 (08:44 +0100)]
vconsole-setup: use a consistent log level when setfont fails with EX_OSERR
Since we accept that setfont(8) can fail with EX_OSERR and we dont treat it as
an error, dont log this failure at LOG_ERR.
Before:
-------
/usr/bin/setfont failed with exit status 71. [LOG_ERR]
Setting fonts failed with a "system error", ignoring. [LOG_NOTICE]
After:
-----
/usr/bin/setfont failed with a "system error" (EX_OSERR), ignoring. [LOG_NOTICE]
Setting source virtual console failed, ignoring remaining ones [LOG_NOTICE]
Follow-up for
93c9a9d235e2304500c490b4868534385f925c76
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 09:36:04 +0000 (10:36 +0100)]
ukify: avoid deprecated datetime call
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for
removal in a future version. Use timezone-aware objects to
represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
The difference between the two is that .now(datetime.UTC) returns an object with
a timezone attached, "the numbers" are the same.
>>> datetime.datetime.utcnow(), datetime.datetime.now(datetime.UTC)
(datetime.datetime(2023, 12, 1, 9, 37, 53, 891669),
datetime.datetime(2023, 12, 1, 9, 37, 53, 891688, tzinfo=datetime.timezone.utc))
This value is fed to cryptography's x509.CertificateBuilder object, so as long
as it can accept a datetime object with tzinfo, the result should be identical.
Luca Boccassi [Fri, 1 Dec 2023 01:44:54 +0000 (01:44 +0000)]
core: do not drop CAP_SETUID if it is in AmbientCapabilities=
Follow-up for
24832d10b604848cf46624bb439c7fac27f3ce3f
Yu Watanabe [Thu, 30 Nov 2023 10:07:36 +0000 (19:07 +0900)]
network: do not send too many netlink messages in a single event
Fixes #26743.
Yu Watanabe [Fri, 1 Dec 2023 05:36:30 +0000 (14:36 +0900)]
firewall-util: introduce fw_ctx_get_reply_callback_count()
Yu Watanabe [Thu, 30 Nov 2023 10:04:37 +0000 (19:04 +0900)]
sd-netlink: introduce netlink_get_reply_callback_count()
Daan De Meyer [Fri, 1 Dec 2023 10:43:04 +0000 (11:43 +0100)]
Merge pull request #30211 from yuwata/sd-journal-generic-array-bisect-fix
sd-journal: fix generic_array_bisect()
Yu Watanabe [Fri, 1 Dec 2023 05:17:58 +0000 (14:17 +0900)]
sd-netlink: change error code of the case that too many replies waiting
ERANGE should be used when setting or parsing a number.
Takashi Sakamoto [Wed, 29 Nov 2023 13:39:50 +0000 (22:39 +0900)]
hwdb: ieee1394-unit-function: arrangement for Sony DVMC-DA1
A commit
6a42bdb37e39 ("hwdb: ieee1394-unit-function: add Sony
DVMC-DA1") is based on kernel feature unreleased yet (furthermore, not
merged yet). The original intension of new entry is to configure permission
of special file for FireWire character device, so this commit changes the
entry so that it can covers the issued case in existent version of Linux
kernel as out best effort.
When the new version of Linux kernel is released with the new feature,
then following commits would fulfill the hwdb with vendor and model names.
Yu Watanabe [Wed, 29 Nov 2023 04:38:36 +0000 (13:38 +0900)]
test: add tests for generic_array_bisect()
Yu Watanabe [Wed, 29 Nov 2023 04:37:53 +0000 (13:37 +0900)]
test: make append_number() optionally return offset of the entry object
Preparation for later commits.
Yu Watanabe [Tue, 28 Nov 2023 21:08:11 +0000 (06:08 +0900)]
test: split out finalization task
Yu Watanabe [Mon, 27 Nov 2023 02:55:49 +0000 (11:55 +0900)]
sd-journal: fix corrupted journal handling of generic_array_bisect()
Let's consider the following case:
- the direction is down,
- no cached entry,
- the array has 5 entry objects,
- the function test_object() reutns TEST_LEFT for the 1st object,
- the 2nd, 3rd, and 4th objects are broken, so generic_array_bisect_step()
returns TEST_RIGHT for the object.
Then, previously, generic_array_bisect_step() updated the values like the following:
0th: (m = 5, left = 0, right = 4, i = 4) -> (m = 4, left = 0, right = 3, RIGHT)
1st: (m = 4, left = 0, right = 3, i = 1) -> (m = 4, left = 2, right = 3, LEFT)
2nd: (m = 4, left = 2, right = 3, i = 2) -> (m = 2, left = 2, right = 1, RIGHT) <- ouch!!
So, assert(left < right) in generic_array_bisect() was triggered.
See issue #30210.
In such situation, there is no matching entry in the array. By returning
TEST_GOTO_PREVIOUS, generic_array_bisect() handles the result so.
Fixes a bug introduced by
ab8f553d1e09088fb1f633e014299e7bf6c30c9e.
Fixes #30210.
Yu Watanabe [Wed, 29 Nov 2023 21:46:21 +0000 (06:46 +0900)]
sd-journal: ignore failure in testing cached corrupted entry
Let's consider the case that the 1st entry in an array is broken, but
n-th entry is valid. Then, if generic_array_get() is called to read
n-th object, the offset of the broken entry is cached by the function.
If generic_array_bisect() is followed, even if the matching entry is
valid, it always fail with -EBADMSG or friends, as the function test the
cached entry at the beginnning. Let's ignore the failure in testing the
cached entry.
Joerg Behrmann [Thu, 30 Nov 2023 10:01:16 +0000 (11:01 +0100)]
man: document how to properly use a target as the Unit= of a timer
Daan De Meyer [Thu, 30 Nov 2023 10:01:14 +0000 (11:01 +0100)]
Make sure we close bpf outer map fd in systemd-executor
Not doing so leaks it into the child service and causes selinux
denials.
Yu Watanabe [Thu, 30 Nov 2023 02:55:27 +0000 (11:55 +0900)]
contrib: include co-authors to the contributor list of NEWS
Closes #30261.
Mike Yuan [Wed, 29 Nov 2023 15:18:23 +0000 (23:18 +0800)]
core/executor: avoid double closing serialization fd
Before this commit, between fdopen() (in parse_argv()) and fdset_remove(),
the serialization fd is owned by both arg_serialization FILE stream and fdset.
Therefore, if something wrong happens between the two calls, or if --deserialize=
is specified more than once, we end up closing the serialization fd twice.
Normally this doesn't matter much, but I still think it's better to fix this.
Let's call fdset_new_fill() after parsing serialization fd hence.
We set the fd to CLOEXEC in parse_argv(), so it will be filtered
when the fdset is created.
While at it, also move fdset_new_fill() under the second log_open(), so
that we always log to the log target specified in arguments.
Yu Watanabe [Thu, 30 Nov 2023 04:05:04 +0000 (13:05 +0900)]
sd-journal: fix typo in function name
Daan De Meyer [Wed, 29 Nov 2023 14:57:46 +0000 (15:57 +0100)]
core: Always call log_open() in systemd-executor
log_setup() will open the console in systemd-executor because it's
not pid 1 and it's not connected to the journal. So if the log target
is later changed to kmsg, we have to reopen the log.
But since log_open() won't open the same log twice, let's just call it
unconditionally since it will be a noop if we try to reopen the same log.
This makes sure that systemd-executor will log to the log target passed
via --log-target= after parsing arguments.
Frantisek Sumsal [Wed, 29 Nov 2023 12:36:54 +0000 (13:36 +0100)]
test: ignore gcov errors with RestrictFileSystems=
The errors are valid, since the file system is indeed not writable, but
we don't care about the missing coverage data in this case.
Follow-up to
4a43c2b3a1.
Daan De Meyer [Wed, 29 Nov 2023 20:18:31 +0000 (21:18 +0100)]
network: Add missing comma
Luca Boccassi [Wed, 29 Nov 2023 16:01:21 +0000 (16:01 +0000)]
Revert "mkosi ci: enable jammy-proposed"
libsolv has migrated to jammy-updates, so we can disable the
proposed-updates repository again.
This reverts commit
48bfc6791dca3b130befe419fc07f15f515b291c.
Daan De Meyer [Wed, 29 Nov 2023 13:46:20 +0000 (14:46 +0100)]
mkosi: Drop building custom kernel logic
Now that mkosi-kernel is a thing, this logic in systemd is just mostly
bitrotting since I just use mkosi-kernel these days. If I ever need to
hack on systemd and the kernel in tandem, I'll just add support for
building systemd to mkosi-kernel instead, so let's drop the support for
building a custom kernel in systemd's mkosi configuration.
Daan De Meyer [Wed, 29 Nov 2023 09:29:06 +0000 (10:29 +0100)]
mkosi: Install integritysetup on CentOS/Fedora
Required for running integration tests
janana [Wed, 29 Nov 2023 03:36:52 +0000 (11:36 +0800)]
rules: go to the end of rules indeed when dm is suspended
The previous patch
466266c does not make sense indeed, that is to say, if the SYSTEMD_READY is not recorded in the database, the GOTO="systemd_end" will not be applied.
The IMPORT{db} is actually a matching token, it returns false when there is no SYSTEMD_READY recorded in the database.
The previous patch
466266c tended to inherit the state of SYSTEMD_READY from the database and skip to the end of current rule file. But when the database does not contain SYSTEMD_READY, e.g., the dm-* is not set db_persistent during initrd and the database will be cleared after switching root, the following rules will still be applied not as expected.
Lennart Poettering [Tue, 28 Nov 2023 22:29:50 +0000 (23:29 +0100)]
stdio-bridge: properly handle org.freedesktop.DBus.Local.Disconnected signal
Previously, we'd forward org.freedesktop.DBus.Local.Disconnected like
any other message to the other side. But that's not OK, as messages in
the org.freedesktop.DBus.Local.* namespace are supposed to never touch
the wire, and are synthetic messages that the library uses to
communicate with the app, but never with other apps.
dbus-daemon never cared, but dbus-broker complains about this, hence
clean this up.
See: #28514
Lennart Poettering [Tue, 28 Nov 2023 20:21:37 +0000 (21:21 +0100)]
stub: get_extra_dir() can return NULL
If we have a device path that is not the usual file system directory
get_extra_dir() will return NULL. Handle that gracefully.
Fixes: #30228
Daan De Meyer [Tue, 28 Nov 2023 22:39:41 +0000 (23:39 +0100)]
Merge pull request #30236 from DaanDeMeyer/mkosi
Update to mkosi v19
Daan De Meyer [Tue, 28 Nov 2023 22:19:44 +0000 (23:19 +0100)]
mkosi: pin CentOS8 kernel to working version
Newer kernels are affected by a regression that causes a kernel panic
on boot when using cgroupv2, so pin them for now. Can be reverted once
that problem is fixed.
Lennart Poettering [Tue, 28 Nov 2023 14:41:41 +0000 (15:41 +0100)]
homed: properly handle operation exit statusses
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2023 16:28:06 +0000 (17:28 +0100)]
shared/cryptsetup-util: build problematic code only in developer mode
This code doesn't link when gcc+lld is used:
$ LDFLAGS=-fuse-ld=lld meson setup build-lld && ninja -C build-lld udevadm
...
ld.lld: error: src/shared/libsystemd-shared-255.a(libsystemd-shared-255.a.p/cryptsetup-util.c.o):
symbol crypt_token_external_path@@ has undefined version
collect2: error: ld returned 1 exit status
As a work-around, restrict it to developer mode.
Closes https://github.com/systemd/systemd/issues/30218.
Дамјан Георгиевски [Tue, 28 Nov 2023 18:53:57 +0000 (19:53 +0100)]
man: typo, it's DHCP not DCHP in DHCPPrefixDelegation=
Daan De Meyer [Tue, 28 Nov 2023 17:38:22 +0000 (18:38 +0100)]
Update to mkosi v19
- Use mkosi.images/ instead of mkosi.presets/
- Use the .chroot suffix to run scripts in the image
- Use BuildSources= match for the kernel build
- Move 10-systemd.conf to mkosi.conf and rely on mkosi.local.conf
for local configuration
Lennart Poettering [Mon, 27 Nov 2023 11:50:09 +0000 (12:50 +0100)]
boot: suffix SecureBoot message with newline
Output is otherwise so weird, since this is the last log line seen for a
while typically, and if it doesn#t put the cursor back in the first
column it looks like something is incomplete and hanging. Hence do what
we always do: finish log messages with a newline.
Lennart Poettering [Tue, 28 Nov 2023 10:05:52 +0000 (11:05 +0100)]
pam-util: fix pam_syslog_pam_error() format string
To cut off a string at some position we must set the "precision" not the
field width in format strings.
This led to some assert()s being hit where they really should not be.
Lennart Poettering [Fri, 24 Nov 2023 13:35:43 +0000 (14:35 +0100)]
gpt-auto-generator: enable TPM2 unlocking in gpt-auto-generator
If we detect a TPM, let's also unlock the disk with it, if it has an
enrollment for that.
Fixes: #30176
Luca Boccassi [Tue, 28 Nov 2023 15:35:11 +0000 (15:35 +0000)]
Merge pull request #30203 from yuwata/resolve-dump-cache
resolve: fix varlink message verification
Luca Boccassi [Tue, 28 Nov 2023 15:33:35 +0000 (15:33 +0000)]
Merge pull request #30216 from poettering/loginctl-table-tweaks
loginctl: minor tweaks to tabular output
Luca Boccassi [Tue, 28 Nov 2023 15:32:08 +0000 (15:32 +0000)]
Merge pull request #30220 from yuwata/journald-vs-soft-reboot
unit: stop journald before SIGKILL on soft-reboot
Lennart Poettering [Mon, 27 Nov 2023 14:10:42 +0000 (15:10 +0100)]
loginctl: show null fields for unset seat/tty fields of sessions
Lennart Poettering [Mon, 27 Nov 2023 14:09:53 +0000 (15:09 +0100)]
loginctl: set appropriate ersatz strings for all tables
Lennart Poettering [Mon, 27 Nov 2023 14:00:12 +0000 (15:00 +0100)]
logind: align columns of a table
Yu Watanabe [Mon, 27 Nov 2023 23:45:31 +0000 (08:45 +0900)]
utmp-wtmp: fix wrong suffix assignment on putting dead process
Fixes a bug introduced by
f1d553e9dfd56f95b7564dd20a0b56e6a0d6492c.
Fixes #30213.
Yu Watanabe [Tue, 28 Nov 2023 04:02:02 +0000 (13:02 +0900)]
core/cgroup: fix compile error
With gcc-13,
```
CFLAGS="-O3 -fno-semantic-interposition" meson setup build
```
triggers the following error:
```
../src/core/cgroup.c: In function ‘cgroup_context_dump’:
../src/core/cgroup.c:633:44: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
633 | "%sDeviceAllow: %s %s\n",
| ^~
cc1: some warnings being treated as errors
```
Fixes #30223.
Yu Watanabe [Sun, 26 Nov 2023 00:25:22 +0000 (09:25 +0900)]
test: check journal files are not corrupted after soft-reboot
Yu Watanabe [Mon, 27 Nov 2023 23:32:22 +0000 (08:32 +0900)]
unit: make journald stopped on soft-reboot before broadcasting SIGKILL
Workaround for #30195.
Yu Watanabe [Sat, 25 Nov 2023 20:43:46 +0000 (05:43 +0900)]
man: also SIGKILL is sent on soft-reboot
Yu Watanabe [Sat, 25 Nov 2023 20:34:10 +0000 (05:34 +0900)]
varlinkctl: add short comment
Yu Watanabe [Mon, 27 Nov 2023 23:25:06 +0000 (08:25 +0900)]
capability-util: avoid false-positive use-of-uninitialized-value error
fuzzers randomly fail with the following:
```
==172==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7f41169cb39b in update_argv /work/build/../../src/systemd/src/basic/argv-util.c:96:13
#1 0x7f41169cb39b in rename_process /work/build/../../src/systemd/src/basic/argv-util.c:210:16
#2 0x7f4116b6824e in safe_fork_full /work/build/../../src/systemd/src/basic/process-util.c:1516:21
#3 0x7f4116bffa36 in safe_fork /work/build/../../src/systemd/src/basic/process-util.h:191:16
#4 0x7f4116bffa36 in parse_timestamp /work/build/../../src/systemd/src/basic/time-util.c:1047:13
#5 0x4a61e6 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-time-util.c:16:16
#6 0x4c4a13 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
#7 0x4c41fa in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
#8 0x4c58c9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
#9 0x4c6595 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
#10 0x4b58ff in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
#11 0x4def52 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#12 0x7f4115ea3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId:
e678fe54a5d2c2092f8e47eb0b33105e380f7340)
#13 0x41f5ad in _start (build-out/fuzz-time-util+0x41f5ad)
DEDUP_TOKEN: update_argv--rename_process--safe_fork_full
Uninitialized value was created by an allocation of 'fv' in the stack frame of function 'have_effective_cap'
#0 0x7f41169d3540 in have_effective_cap /work/build/../../src/systemd/src/basic/capability-util.c:21
```
Yu Watanabe [Sun, 26 Nov 2023 21:26:07 +0000 (06:26 +0900)]
test: verify json format passed through varlink
This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal,
as the expected logs from test-varlink-idl makes the post script fail.
Saving logs in journal is simply noisy, and we will output anyway after
qemu or nspawn finished by check_result_{qemu,nspawn}_unittests().
Yu Watanabe [Mon, 27 Nov 2023 00:42:15 +0000 (09:42 +0900)]
test: show saved journal files after TEST-02-UNITTESTS
Yu Watanabe [Sun, 26 Nov 2023 20:59:56 +0000 (05:59 +0900)]
Yu Watanabe [Sun, 26 Nov 2023 04:12:19 +0000 (13:12 +0900)]
test: add simple coverity test for 'resolvectl show-cache'
Yu Watanabe [Sun, 26 Nov 2023 20:41:22 +0000 (05:41 +0900)]
varlink: fix key name in reply of org.varlink.service.GetInterfaceDescription
Fixes https://github.com/systemd/systemd/pull/30203#issuecomment-
1826746111.
Yu Watanabe [Sun, 26 Nov 2023 04:10:15 +0000 (13:10 +0900)]
resolve: fix varink message verification
Fixes #30199.
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2023 19:58:43 +0000 (20:58 +0100)]
test-time-util: suppress timestamp conversion failures for Africa/Khartoum timezone
Our timestamp conversion roundtrip test was failing. But I think that this
is not our bug:
$ TZ='Africa/Khartoum' date --date='@
1509482094'
Tue Oct 31 23:34:54 EAT 2017
$ TZ='Africa/Khartoum' date --date='Tue Oct 31 23:34:54 EAT 2017' +%s
1509485694
$ TZ='Africa/Khartoum' date --date='@
1509485694'
Tue Oct 31 23:34:54 CAT 2017
$ echo $[
1509485694 -
1509482094]
3600
This is essentially the same as what happens in our test. After a round-trip, we
end up one hour ahead.
> For
1509482094632752, from the change log of tzdata:
>
> Release 2017c - 2017-10-20 14:49:34 -0700
>
> Changes to future timestamps
> Sudan will switch from +03 to +02 on 2017-11-01.
Fixes https://github.com/systemd/systemd/issues/28472.
Luca Boccassi [Mon, 27 Nov 2023 15:44:50 +0000 (15:44 +0000)]
Merge pull request #30170 from bluca/exec_bpf_fd
core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set
Adam Goldman [Sun, 26 Nov 2023 10:45:25 +0000 (02:45 -0800)]
hwdb: ieee1394-unit-function: add Sony DVMC-DA1
This commit adds a hwdb entry for the Sony DVMC-DA1. This media converter
works with video capture software such as dvgrab, but it doesn't support
the AV/C command set and doesn't match the general entry.
Yu Watanabe [Sun, 26 Nov 2023 00:10:09 +0000 (09:10 +0900)]
Merge pull request #30200 from mrc0mmand/test-tweaks
A couple of assorted fixes
Frantisek Sumsal [Sat, 25 Nov 2023 21:30:01 +0000 (22:30 +0100)]
test: drop 'noearly' from crypttab
It's a Debian thing, we don't support it.
[ 30.639971] testsuite-64.sh[475]: + systemctl restart cryptsetup.target
[ 30.697667] systemd-cryptsetup[3389]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[ 30.700529] systemd-cryptsetup[3390]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[ 30.700594] systemd-cryptsetup[3391]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[ 30.704638] systemd-cryptsetup[3392]: Encountered unknown /etc/crypttab option 'noearly', ignoring
Frantisek Sumsal [Sat, 25 Nov 2023 20:59:57 +0000 (21:59 +0100)]
test: drop invalid LogTarget= assignment
It's been there since the test was introduced and I'm not really sure
what was the original intention behind it, but it makes systemd sad:
[ 4.909056] systemd[1]: /usr/lib/systemd/tests/testdata/units/testsuite-44.service:13: Unknown key name 'LogTarget' in section 'Service', ignoring.
Frantisek Sumsal [Sat, 25 Nov 2023 20:36:10 +0000 (21:36 +0100)]
systemctl: include unit ID in the property map
Otherwise we get a not very nice message when trying to display a
non-existent man page:
~# systemctl cat test.service
[Unit]
Description=Hello
[Service]
ExecStart=true
~# systemctl help test.service
Documentation for (null) not known.
Frantisek Sumsal [Sat, 25 Nov 2023 19:42:13 +0000 (20:42 +0100)]
import: append % to X_IMPORT_PROGRESS=
Since we parse it on the other side via parse_percent() which requires
that, otherwise we get an error:
[ 8.133131] testsuite-13.sh[649]: + machinectl import-raw /tmp/container.raw container-raw
[ 8.175035] machinectl[1143]: Enqueued transfer job 1. Press C-c to continue download in background.
[ 8.182130] machinectl[1143]: Importing '/tmp/container.raw', saving as 'container-raw'.
[ 8.182377] systemd-importd[1144]: Got invalid percent value '0', ignoring.
[ 8.182451] machinectl[1143]: Imported 0%.
[ 8.282669] systemd-importd[1144]: Got invalid percent value '40', ignoring.
[ 8.282746] machinectl[1143]: Imported 40%.
[ 8.366448] machinectl[1143]: Wrote 64.0M.
[ 8.366519] machinectl[1143]: Operation completed successfully.
[ 8.366617] machinectl[1143]: Exiting.
Frantisek Sumsal [Sat, 25 Nov 2023 19:22:24 +0000 (20:22 +0100)]
test: remove the reboot counter just before spawning container/VM
Doing that in test_run() is not enough, since it's called only once and
spawns all QEMU/nspawn jobs.
Yu Watanabe [Sat, 25 Nov 2023 18:30:58 +0000 (03:30 +0900)]
Merge pull request #30196 from YHNdnzj/fchmodat2-no-symlink
Revert "nspawn-patch-uid: try fchmodat2() to restore mode of symlink"
Yu Watanabe [Sat, 25 Nov 2023 17:28:06 +0000 (02:28 +0900)]
Merge pull request #30197 from keszybz/vconsole-restart-no-limit
Drop restart limit for systemd-vconsole-setup.service and some man page tweaks
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2023 12:27:17 +0000 (13:27 +0100)]
units: disable start rate limit for systemd-vconsole-setup.service
The unit will be started or restarted a few times during boot, but but it has
StartLimitBurst = DefaultStartLimitBurst = 5, which means that the fifth
restart will already fail. On my laptop, I have exactly 4 restarts, so I don't
hit the limit, but on a slightly different system we will easily hit the limit.
In https://bugzilla.redhat.com/show_bug.cgi?id=
2251394, there are five reloads
and we hit the limit.
Since
6ef512c0bb7aeb2000588d7d05e23b4681da8657 we propagate the start counter
over switch-root and daemon reloads, so it's easier to hit the limit during
boot.
In principle there might be systems with lots of vtcon devices, so let's just
allow the unit to be restarted without a limit.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
2251394.
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2023 12:15:31 +0000 (13:15 +0100)]
man/systemd-vconsole-setup: improve markup
Mike Yuan [Sat, 25 Nov 2023 11:10:50 +0000 (19:10 +0800)]
nspawn-patch-uid: clarify that changing mode of symlink is unsupported
Mike Yuan [Sat, 25 Nov 2023 10:57:53 +0000 (18:57 +0800)]
Revert "nspawn-patch-uid: try fchmodat2() to restore mode of symlink"
This reverts commit
30462563b19b92d8c6ed196d30d3cf7de90e8131.
fchmodat2(), while accepting AT_SYMLINK_NOFOLLOW as a valid flag,
always returns EOPNOTSUPP when operating on a symlink. The Linux kernel
simply doesn't support changing the mode of a symlink.
Fixes #30157
Yu Watanabe [Sat, 25 Nov 2023 03:54:11 +0000 (12:54 +0900)]
Merge pull request #30119 from mrc0mmand/test-console
test: don't redirect stdout/stderr to console
Paymon MARANDI [Wed, 22 Nov 2023 16:44:25 +0000 (11:44 -0500)]
ukify: be more explicit about where to find ukify
when KERNEL_INSTALL_UKIFY is not supplied we set ukify to $PWD/ukify
that will fail (perhaps only for manual installations):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/linux-6.7-rc1/ukify'
this will make sure we have a sane default for UKIFY
Signed-off-by: Paymon MARANDI <paymon@utubeipod.xyz>
huyubiao [Fri, 24 Nov 2023 06:43:43 +0000 (14:43 +0800)]
udevadm: exiting udevadm monitor normally under SIGTERM or SIGINT
Under SIGTERM or SIGINT, exit event and release resources, and exit udevadm monitor normally.
Yu Watanabe [Fri, 24 Nov 2023 14:42:04 +0000 (23:42 +0900)]
analyze: return earlier when there is no path to be prepended
Follow-up for
2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8.
Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/30172#discussion_r1404209035
Yu Watanabe [Sat, 25 Nov 2023 03:52:48 +0000 (12:52 +0900)]
Merge pull request #30188 from YHNdnzj/memory-accounting-followup
core: a few fixes and improvements for memory accounting
Yu Watanabe [Fri, 24 Nov 2023 16:05:41 +0000 (01:05 +0900)]
run: escape command for description
The command arguments may contain spurious characters, e.g. line-break.
When we use command arguments as a description of a unit, we should
escape them.
Fixes #30187.
Lennart Poettering [Fri, 24 Nov 2023 17:05:47 +0000 (18:05 +0100)]
rules: don't condition usb-gadget.target target on 'add' action
The dependency should exist continously, like all our similar deps do.
Hence drop the "add" conditionalization.
Frantisek Sumsal [Tue, 21 Nov 2023 08:37:21 +0000 (09:37 +0100)]
test: don't redirect stdout/stderr to console
Turns out that redirecting a lot of output to the console can have some
funny effects, like random kernel soft lockups. I spotted this in
various CIs, but it remained almost entirely hidden thanks to
`softlockup_panic=1`, until
1a36d2672f which introduced a couple of
tests that log quite a lot in a short amount of time. This, in
combination with newer kernel version, which, for some reason, seem to
be more susceptible to such soft lockups, made the Arch Linux jobs soft
lockup quite a lot, see [0].
While debugging this I also noticed that runs which don't redirect
stdout/stderr to the console are noticeably faster, e.g.:
# TEST-71 nspawn + QEMU (KVM), StandardOutput=journal+console
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:24.64
# TEST-71 nspawn + QEMU (KVM), StandardOutput=journal
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:17.95
# TEST-71 nspawn + QEMU, StandardOutput=journal+console
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:04.70
# TEST-71 nspawn + QEMU, StandardOutput=journal
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:44.48
# TEST-04 QEMU, StandardOutput=journal+console
Elapsed (wall clock) time (h:mm:ss or m:ss): 4:22.70
# TEST-04 QEMU, StandardOutput=console
Elapsed (wall clock) time (h:mm:ss or m:ss): 5:04.67
Given all this, let's effectively revert
ba7abf79a5, and dump the
testsuite-related journal messages only after the test finishes, so they
don't go through the slow console.
Resolves: systemd/systemd-centos-ci#660
[0] https://github.com/systemd/systemd-centos-ci/issues/660
Frantisek Sumsal [Fri, 24 Nov 2023 15:00:15 +0000 (16:00 +0100)]
test: add a couple of tests for RestrictFileSystems=
Mike Yuan [Fri, 24 Nov 2023 15:20:41 +0000 (23:20 +0800)]
core/cgroup: use the cached memory accounting value when cgroup is gone
Follow-up for
9824ab1f009e99b0b9d273ace4c98cc687a4c1d7
Fixes https://github.com/systemd/systemd/issues/28542#issuecomment-
1825413237