]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agojournal: use usec_add() and usec_sub_unsigned()
Yu Watanabe [Mon, 4 Dec 2023 07:19:47 +0000 (16:19 +0900)] 
journal: use usec_add() and usec_sub_unsigned()

2 years agojournal: add short comment for boolean arguments
Yu Watanabe [Mon, 4 Dec 2023 07:12:45 +0000 (16:12 +0900)] 
journal: add short comment for boolean arguments

2 years agojournal: split out server_new() from server_init()
Yu Watanabe [Mon, 4 Dec 2023 07:06:20 +0000 (16:06 +0900)] 
journal: split out server_new() from server_init()

Then, use DEFINE_MAIN_FUNCTION() macro in journald.
No functional change, just refactoring to follow our usual coding style.

2 years agotest: load the io controller before checking if io.latency exists
Frantisek Sumsal [Tue, 5 Dec 2023 11:22:20 +0000 (12:22 +0100)] 
test: load the io controller before checking if io.latency exists

Otherwise the following test gets always skipped.

2 years agorepart: Fix sysext definitions for --make-ddi=
Daan De Meyer [Tue, 5 Dec 2023 10:21:15 +0000 (11:21 +0100)] 
repart: Fix sysext definitions for --make-ddi=

CopyFiles= does not support multiple directories separated by
whitespace. Instead the setting has to be specified multiple times.

2 years agoselinux: downgrade log about state to trace
Luca Boccassi [Tue, 5 Dec 2023 11:53:31 +0000 (11:53 +0000)] 
selinux: downgrade log about state to trace

It is printed on every invocation of sd-executor, which is noisy and not useful

Follow-up for: bb5232b6a3b8a

2 years agosd-journal/catalog: modernize write_catalog() 30338/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Dec 2023 18:17:20 +0000 (19:17 +0100)] 
sd-journal/catalog: modernize write_catalog()

2 years agonetworkd: unvoidify fwrite()
Zbigniew Jędrzejewski-Szmek [Tue, 5 Dec 2023 18:03:26 +0000 (19:03 +0100)] 
networkd: unvoidify fwrite()

Those were the only two places we did that, so for consistency it's better
to drop it.

2 years agovariuos: fwrite() does not set errno
Zbigniew Jędrzejewski-Szmek [Tue, 5 Dec 2023 18:02:14 +0000 (19:02 +0100)] 
variuos: fwrite() does not set errno

The man page doesn't even mention errno. It just says that ferror() should
be used to check for errors. Those writes are unlikely to fail, but if they
do, errno might even be 0. Also, we have fflush_and_check() which does
additional paranoia around errno, because we apparently do not trust that
errno will always be set correctly.

2 years agoTEST-26: add test for systemctl edit --stdin 30302/head
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 16:15:13 +0000 (17:15 +0100)] 
TEST-26: add test for systemctl edit --stdin

2 years agosystemctl: add "edit --stdin"
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 15:25:15 +0000 (16:25 +0100)] 
systemctl: add "edit --stdin"

This is a fancy wrapper around "cat <<EOF", but:
- the user doesn't need to figure out the file name,
- parent directories are created automatically,
- daemon-reload is implied,
so it's a convenient way to create units or drop-ins.

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

2 years agoswitch-root: also check that mount IDs are the same, not just inodes 30332/head
Luca Boccassi [Tue, 5 Dec 2023 15:43:12 +0000 (15:43 +0000)] 
switch-root: also check that mount IDs are the same, not just inodes

If /run/nextroot/ has been set up, use it, even if the inodes are
the same. It could be a verity device that is reused, but with
different sub-mounts or other differences. Or the same / tmpfs with
different /usr/ mounts. If it was explicitly set up we should use it.

Use the new helper to check that the mount IDs are also the same,
not just the inodes.

2 years agobasic: add fds_are_same_mount() helper
Luca Boccassi [Tue, 5 Dec 2023 15:32:30 +0000 (15:32 +0000)] 
basic: add fds_are_same_mount() helper

2 years agosystemctl: add message when edit is aborted
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 15:41:46 +0000 (16:41 +0100)] 
systemctl: add message when edit is aborted

If the user edits result in an empty file (after stripping), we would silently
not do anything, aborting the edit. This is rather confusing, let's emit a
notice:

  $ build/systemctl --user edit asdf.service --full --stdin </dev/null
  /home/zbyszek/.config/systemd/user/asdf.service: after editing, new contents are empty, not writing file.

(This also works with an editor, instead of --stdin. The message is printed on
the console and is visible after the editor exits.)

While at it, fix the condition to skip writing file after stripping. We had
"old_contents", but we modified that string. In some code flows, we would
compare the stripped old contents (i.e. a string which by defintion doesn't
have a newline at the end) with a string to which we just appended a newline
(i.e. a string which by defintion has a newline at the end).

2 years agoshared/edit-util: split out function to populate temp file
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 15:06:56 +0000 (16:06 +0100)] 
shared/edit-util: split out function to populate temp file

In preparation for future changes: I want to add a mode where interactive
editing is not done, and when this preparation is moved to a helper, it's much
easier to skip it.

e->line is initialized to 1 and overwritten even if sync fails. Theoretically
this is against our style, but the alternative is to propagate a temporary
value of line through the layers, which adds a lot of noise. If we fail, this
EditFile object will not be used for anything, to the changed value of .line
has no effect.

2 years agobasic: fix typo
Yu Watanabe [Tue, 5 Dec 2023 14:50:25 +0000 (23:50 +0900)] 
basic: fix typo

2 years agosystemctl: add support for Sleep() logind call 29853/head
Mike Yuan [Fri, 3 Nov 2023 13:25:42 +0000 (21:25 +0800)] 
systemctl: add support for Sleep() logind call

2 years agologind: introduce Sleep() call and action that automatically choose a sleep operation
Mike Yuan [Thu, 2 Nov 2023 17:11:55 +0000 (01:11 +0800)] 
logind: introduce Sleep() call and action that automatically choose a sleep operation

2 years agologind: test: make sure string of HandleAction and SleepOperation match
Mike Yuan [Thu, 2 Nov 2023 17:07:26 +0000 (01:07 +0800)] 
logind: test: make sure string of HandleAction and SleepOperation match

2 years agologind: put more struct members into designated initializer
Mike Yuan [Fri, 3 Nov 2023 18:06:28 +0000 (02:06 +0800)] 
logind: put more struct members into designated initializer

2 years agologind: take HandleAction instead of HandleActionData at several places
Mike Yuan [Thu, 2 Nov 2023 16:19:23 +0000 (00:19 +0800)] 
logind: take HandleAction instead of HandleActionData at several places

Preparation for addition of HANDLE_SLEEP.

2 years agofix: The example2 in hwdb.xml is unreasonable
huyubiao [Tue, 5 Dec 2023 12:53:32 +0000 (20:53 +0800)] 
fix: The example2 in hwdb.xml is unreasonable

use evdev:atkbd:dmi:bvnAcer:bvr:bdXXXXX:bd08/05/2010:svnAcer:pnX123: instead of evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123

2 years agohibernate-resume: always clear HibernateLocation if system info matches 30322/head
Mike Yuan [Tue, 5 Dec 2023 08:37:36 +0000 (16:37 +0800)] 
hibernate-resume: always clear HibernateLocation if system info matches

Follow-up for a628d933cc67cc8b183dc809ba1451aa5b2996e5

HibernateInfo.from_efi is not actually useful. info.efi is only
set if the system identifier stored in EFI variable matches with
that of the running system, and thus the variable should be cleared
no matter whether resume= is set from kernel cmdline or not.

2 years agosleep: reduce the scope of hibernation_device
Mike Yuan [Mon, 4 Dec 2023 13:17:03 +0000 (21:17 +0800)] 
sleep: reduce the scope of hibernation_device

2 years agohibernate-util: return 1 for hibernation_is_safe only when all checks pass
Mike Yuan [Sat, 25 Nov 2023 07:07:17 +0000 (15:07 +0800)] 
hibernate-util: return 1 for hibernation_is_safe only when all checks pass

The return value is currently not used, but let's correct this.

2 years agotest: set correct group for systemd-journal-upload tests 30316/head
Frantisek Sumsal [Mon, 4 Dec 2023 20:33:15 +0000 (21:33 +0100)] 
test: set correct group for systemd-journal-upload tests

We can't use the systemd-journal-upload user here, since it's created
dynamically by DynamicUser=yes. However, we can use the group specified
in SupplementaryGroups=, so do exactly that.

2 years agoRevert "sysusers.d: create the user for systemd-journal-upload.service"
Frantisek Sumsal [Mon, 4 Dec 2023 18:23:54 +0000 (19:23 +0100)] 
Revert "sysusers.d: create the user for systemd-journal-upload.service"

I have no idea what was my reasoning that led to this change, but it is
simply wrong: systemd-journal-upload.service uses
User=systemd-journal-upload together with DynamicUser=yes, so the user
doesn't have to (and shouldn't) exist before starting the service.

See:
  - https://github.com/systemd/systemd/commit/941afc4b902af21b0675e9e5d417c2ee6b202f30
  - https://src.fedoraproject.org/rpms/systemd/c/db8b8fe77ce30244ad82e70ec4e8302b0c9dbf41

This reverts commit 5b9dfd33c6cd4d32ee1fd3681b570e09401c885d.

2 years agoMerge pull request #30313 from mrc0mmand/ubuntu-ci
Luca Boccassi [Mon, 4 Dec 2023 18:23:34 +0000 (18:23 +0000)] 
Merge pull request #30313 from mrc0mmand/ubuntu-ci

Reduce the number of deny-list files for Ubuntu CI

2 years agotools/meson-vcs-tag: the third argument is optional
Yu Watanabe [Mon, 4 Dec 2023 03:36:53 +0000 (12:36 +0900)] 
tools/meson-vcs-tag: the third argument is optional

Follow-up for 1a71ac07adafebe7e0074f92d049f72968ca2d47.

2 years agoMerge pull request #30314 from DaanDeMeyer/dmi
Luca Boccassi [Mon, 4 Dec 2023 10:29:06 +0000 (10:29 +0000)] 
Merge pull request #30314 from DaanDeMeyer/dmi

Document kernel configs required for reading credentials from SMBIOS

2 years agomkosi: Update comment why we can't use linux-kvm yet 30314/head
Daan De Meyer [Mon, 4 Dec 2023 10:16:52 +0000 (11:16 +0100)] 
mkosi: Update comment why we can't use linux-kvm yet

2 years agoDocument kernel configs required for reading credentials from SMBIOS
Daan De Meyer [Mon, 4 Dec 2023 10:13:59 +0000 (11:13 +0100)] 
Document kernel configs required for reading credentials from SMBIOS

2 years agotest: reenable TEST-30 on i*86 30313/head
Frantisek Sumsal [Mon, 4 Dec 2023 09:57:39 +0000 (10:57 +0100)] 
test: reenable TEST-30 on i*86

The original reason for deny-listing it was that it's flaky there. I'm
not sure if that's still the case, but the Ubuntu CI jobs for i*86 are
gone, so this file shouldn't be needed anymore anyway.

2 years agotest: skip TEST-36 on s390x and powerpc
Frantisek Sumsal [Mon, 4 Dec 2023 09:51:35 +0000 (10:51 +0100)] 
test: skip TEST-36 on s390x and powerpc

As QEMU there doesn't support NUMA nodes. Also, drop the now unneeded
deny-list file for Ubuntu CI.

2 years agotest: check if 'btrfs filesystem' supports 'mkswapfile'
Frantisek Sumsal [Mon, 4 Dec 2023 09:23:42 +0000 (10:23 +0100)] 
test: check if 'btrfs filesystem' supports 'mkswapfile'

Instead of deny-listing the test on Ubuntu CI, so it gets enabled
automagically once btrfs-progs is updated to a newer version there.

2 years agotest: reenable TEST-25-IMPORT in Ubuntu CI
Frantisek Sumsal [Mon, 4 Dec 2023 09:16:02 +0000 (10:16 +0100)] 
test: reenable TEST-25-IMPORT in Ubuntu CI

Let's see if #13973 is still an issue.

2 years agotest: add test for seqnum and seqnum ID 30263/head
Yu Watanabe [Fri, 1 Dec 2023 03:29:11 +0000 (12:29 +0900)] 
test: add test for seqnum and seqnum ID

2 years agojournald: also remove runtime journal directories with a different machine ID
Yu Watanabe [Sun, 3 Dec 2023 12:56:26 +0000 (21:56 +0900)] 
journald: also remove runtime journal directories with a different machine ID

Otherwise, even if the journal files in the directories are flushed to
the persistent storage, still they are opened by e.g. journalctl, and it
may show duplicated entries.
Also, the journal files may be flushed to the persistent storage more
than once.

2 years agojournald: close runtime journals before their parent directory removed
Yu Watanabe [Sun, 3 Dec 2023 12:41:55 +0000 (21:41 +0900)] 
journald: close runtime journals before their parent directory removed

No functional change, just for safety.

2 years agojournald: reset runtime seqnum data when flushing to system journal
msizanoen [Fri, 24 Nov 2023 11:56:31 +0000 (18:56 +0700)] 
journald: reset runtime seqnum data when flushing to system journal

Follow-up for e5d60d1b3b0c0b229571823c7fdd390a9562982e.

The current system journal's seqnum ID will usually be different from
the seqnum ID of the current runtime journal. Therefore, to avoid
unnecessary rotations on boot, reset the runtime seqnum data when
switching to system journal so that systemd-journald will adopt the
system journal's seqnum ID and value on next write.

Fixes #30092

2 years agoexecutor: apply LogLevelMax earlier
Luca Boccassi [Sun, 3 Dec 2023 18:30:07 +0000 (18:30 +0000)] 
executor: apply LogLevelMax earlier

SELinux logs before we have a chance to apply it, move it up as it
breaks TEST-04-JOURNAL:

[  408.578624] testsuite-04.sh[11463]: ++ journalctl -b -q -u silent-success.service
[  408.578743] testsuite-04.sh[11098]: + [[ -z Dec 03 13:38:41 H systemd-executor[11459]: SELinux enabled state cached to: disabled ]]

Follow-up for: bb5232b6a3b8a

2 years agoMerge pull request #30305 from yuwata/seccomp-fix
Yu Watanabe [Mon, 4 Dec 2023 02:44:58 +0000 (11:44 +0900)] 
Merge pull request #30305 from yuwata/seccomp-fix

seccomp: override the default action only when the filter is allow-list

2 years agotests: fix section mapping in test_ukify.py
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 09:26:05 +0000 (10:26 +0100)] 
tests: fix section mapping in test_ukify.py

The regexp only worked if the sections were small enough for the size to
start with "0". I have an initrd that is 0x1078ec7e bytes, so the tests
would spuriously fail.

2 years agoMerge pull request #30297 from keszybz/fixups
Luca Boccassi [Sun, 3 Dec 2023 12:34:24 +0000 (12:34 +0000)] 
Merge pull request #30297 from keszybz/fixups

A few unrelated fixups for recent commits

2 years agoseccomp-util: also use ENOSYS for unknown syscalls in seccomp_load_syscall_filter_set() 30305/head
Yu Watanabe [Sun, 3 Dec 2023 09:01:20 +0000 (18:01 +0900)] 
seccomp-util: also use ENOSYS for unknown syscalls in seccomp_load_syscall_filter_set()

Follow-up for 2331c02d06cae97b87637a0fc6bb4961b509ccf2.

Note, currently, the function is always called with SCMP_ACT_ALLOW as
the default action, except for the test. So, this should not change
anything in the runtime code.

2 years agoseccomp-util: override default action only when the filter is allow-list
Yu Watanabe [Sun, 3 Dec 2023 08:37:02 +0000 (17:37 +0900)] 
seccomp-util: override default action only when the filter is allow-list

Follow-up for 2331c02d06cae97b87637a0fc6bb4961b509ccf2.

Fixes #30304.

2 years agoman/systemctl: fix indentation of <xi:include>'s
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 15:48:24 +0000 (16:48 +0100)] 
man/systemctl: fix indentation of <xi:include>'s

2 years agoshared/verb: indentation
Zbigniew Jędrzejewski-Szmek [Sat, 2 Dec 2023 14:24:46 +0000 (15:24 +0100)] 
shared/verb: indentation

2 years agonetworkctl: introduce --runtime for editing network config under /run/ 30085/head
Mike Yuan [Fri, 17 Nov 2023 14:08:28 +0000 (22:08 +0800)] 
networkctl: introduce --runtime for editing network config under /run/

2 years agonetworkctl: drop one assertion
Mike Yuan [Tue, 21 Nov 2023 13:21:14 +0000 (21:21 +0800)] 
networkctl: drop one assertion

If there're no existing drop-ins, the assertions
are unnecessarily triggered.

2 years agonetworkctl: use RET_GATHER more
Mike Yuan [Fri, 17 Nov 2023 12:37:26 +0000 (20:37 +0800)] 
networkctl: use RET_GATHER more

2 years agostdio-bridge: return immediately if we can 30297/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Nov 2023 13:38:06 +0000 (14:38 +0100)] 
stdio-bridge: return immediately if we can

Follow-up for 0321248b79d14ceddd36140b327332f145ae68e7.

2 years agorun: fix bad escaping and memory ownership confusion
Zbigniew Jędrzejewski-Szmek [Wed, 29 Nov 2023 13:13:33 +0000 (14:13 +0100)] 
run: fix bad escaping and memory ownership confusion

arg_description was either set to arg_unit (i.e. a const char*), or to
char *description, the result of allocation in run(). But description
was decorated with _cleanup_, so it would be freed when going out of the
function. Nothing bad would happen, because the program would exit after
exiting from run(), but this is just all too messy.

Also, strv_join(" ") + shell_escape() is not a good way to escape command
lines. In particular, one the join has happened, we cannot distinguish
empty arguments, or arguments with whitespace, etc. We have a helper
function to do the escaping properly, so let's use that.

Fixup for 2c29813da3421b77eca5e5cdc3b9a863cad473b9.

2 years agorun: adjust indentation
Zbigniew Jędrzejewski-Szmek [Wed, 29 Nov 2023 13:01:13 +0000 (14:01 +0100)] 
run: adjust indentation

2 years agotest-macro: use capital test names for macro tests
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2023 14:54:11 +0000 (15:54 +0100)] 
test-macro: use capital test names for macro tests

It's just easier if the test is named as the thing being tested. Also, this way
inconsistent, because lower in the file uppercase test names are used.

2 years agoNEWS: finalize for v255-rc4 v255-rc4
Luca Boccassi [Sat, 2 Dec 2023 02:05:27 +0000 (02:05 +0000)] 
NEWS: finalize for v255-rc4

2 years agoMerge pull request #30291 from keszybz/seccomp-unknown-syscall
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

2 years agocore: turn on higher optimization level in seccomp 30291/head
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.

2 years agoshared/seccomp-util: use the same error message for the same condition
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.

2 years agocore: when applying syscall filters, use ENOSYS for unknown calls
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.

2 years agocore/cgroup: for non-cached attrs, don't return ENODATA blindly
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...

2 years agoMerge pull request #30294 from bluca/news
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

2 years agosystemd-homed.service.in: add quotactl to SystemCallFilter
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

2 years agohwdb: update 30294/head
Luca Boccassi [Fri, 1 Dec 2023 22:07:08 +0000 (22:07 +0000)] 
hwdb: update

2 years agoNEWS: update contributors list
Luca Boccassi [Fri, 1 Dec 2023 22:05:08 +0000 (22:05 +0000)] 
NEWS: update contributors list

2 years agoMerge pull request #30268 from yuwata/network-fix-too-many-waiting-replies
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

2 years agocore: fix comment
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2023 14:53:06 +0000 (15:53 +0100)] 
core: fix comment

2 years agofix: prefix of dmesg pstore files
Дамјан Георгиевски [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

2 years agohomework-quota.c: correct error message in home_update_quota_btrfs
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

2 years agobuild(deps): bump meson from 1.2.3 to 1.3.0 in /.github/workflows
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>
2 years agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
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>
2 years agobuild(deps): bump redhat-plumbers-in-action/devel-freezer
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>
2 years agobuild(deps): bump actions/github-script from 6.4.1 to 7.0.1
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>
2 years agobuild(deps): bump github/codeql-action from 2.21.9 to 2.22.8
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>
2 years agovconsole-setup: use a consistent log level when setfont fails with EX_OSERR
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

2 years agoukify: avoid deprecated datetime call
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.

2 years agocore: do not drop CAP_SETUID if it is in AmbientCapabilities=
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

2 years agonetwork: do not send too many netlink messages in a single event 30268/head
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.

2 years agofirewall-util: introduce fw_ctx_get_reply_callback_count()
Yu Watanabe [Fri, 1 Dec 2023 05:36:30 +0000 (14:36 +0900)] 
firewall-util: introduce fw_ctx_get_reply_callback_count()

2 years agosd-netlink: introduce netlink_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()

2 years agoMerge pull request #30211 from yuwata/sd-journal-generic-array-bisect-fix
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()

2 years agoukify: simplify import 30232/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2023 15:55:45 +0000 (16:55 +0100)] 
ukify: simplify import

2 years agokernel-install/60-ukify: use exec() instead of runpy
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2023 15:52:21 +0000 (16:52 +0100)] 
kernel-install/60-ukify: use exec() instead of runpy

As suggested by Daniele Nicolodi.

Also drop left-over debug line.

2 years agoman/ukify: link to competing tools
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2023 09:11:56 +0000 (10:11 +0100)] 
man/ukify: link to competing tools

Right now each of the three invocations yields a part of the picture.
Let's make it easier for users to discover the right tools.

2 years agosd-netlink: change error code of the case that too many replies waiting
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.

2 years agohwdb: ieee1394-unit-function: arrangement for Sony DVMC-DA1
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.

2 years agotest: add tests for generic_array_bisect() 30211/head
Yu Watanabe [Wed, 29 Nov 2023 04:38:36 +0000 (13:38 +0900)] 
test: add tests for generic_array_bisect()

2 years agotest: make append_number() optionally return offset of the entry object
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.

2 years agotest: split out finalization task
Yu Watanabe [Tue, 28 Nov 2023 21:08:11 +0000 (06:08 +0900)] 
test: split out finalization task

2 years agosd-journal: fix corrupted journal handling of generic_array_bisect()
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.

2 years agosd-journal: ignore failure in testing cached corrupted entry
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.

2 years agoman: document how to properly use a target as the Unit= of a timer
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

2 years agocore/exec-invoke: prevent potential double-close of exec_fd 30271/head
Mike Yuan [Thu, 30 Nov 2023 12:09:29 +0000 (20:09 +0800)] 
core/exec-invoke: prevent potential double-close of exec_fd

If exec_fd is closed in add_shifted_fd() by close_and_replace(),
but something goes wrong later, we may close exec_fd twice
in exec_params_shallow_clear().

2 years agocore/exec-invoke: remove redundant fd_cloexec() call
Mike Yuan [Thu, 30 Nov 2023 11:24:01 +0000 (19:24 +0800)] 
core/exec-invoke: remove redundant fd_cloexec() call

2 years agofdset: set all collected fds to CLOEXEC in fdset_new_fill()
Mike Yuan [Thu, 30 Nov 2023 16:00:27 +0000 (00:00 +0800)] 
fdset: set all collected fds to CLOEXEC in fdset_new_fill()

2 years agocore/exec-invoke: rename flags_fds to flag_fds
Mike Yuan [Thu, 30 Nov 2023 11:16:49 +0000 (19:16 +0800)] 
core/exec-invoke: rename flags_fds to flag_fds

2 years agocore/execute-serialize: FOREACH_ARRAY at one more place
Mike Yuan [Thu, 30 Nov 2023 11:13:12 +0000 (19:13 +0800)] 
core/execute-serialize: FOREACH_ARRAY at one more place

2 years agoMake sure we close bpf outer map fd in systemd-executor
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.

2 years agojournalctl: add short option "-i" for "--file=" 30241/head
Lennart Poettering [Tue, 28 Nov 2023 20:29:31 +0000 (21:29 +0100)] 
journalctl: add short option "-i" for "--file="

I see myself frequently typing in "journalctl --file=…". That's a lot to
type. Let's add a short switch too. Unfortunately, "-f" and "-F" are
already taken, hence let's pick "-i".

2 years agoman: add '=' suffix to journalctl switches that take parameter
Lennart Poettering [Tue, 28 Nov 2023 20:29:05 +0000 (21:29 +0100)] 
man: add '=' suffix to journalctl switches that take parameter

As per coding style recommendations.