1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00
Commit Graph

55950 Commits

Author SHA1 Message Date
Yu Watanabe
8a7d048d1d sd-dhcp-server: set DHCPLease::server before hashmap_put()
Otherwise, if the second push is failed, then the first hashmap contains
dirty entry.

Also, this makes hashmap_remove_value() used when removing leases to
make not wrong lease is removed from the hashmap.

Note, this just hide the root cause of the issue #22253, which will be
fixed in later commit.

Fixes #22253.
2022-02-01 11:45:51 +09:00
Yu Watanabe
37e219800f sd-dhcp-server: fix indentation 2022-02-01 11:45:51 +09:00
Yu Watanabe
48be485b71 sd-dhcp-server: rename argument and add one missing assertion 2022-02-01 11:45:51 +09:00
Yu Watanabe
6277e48fa9 sd-dhcp-server: do not use implicit cast to boolean from integer 2022-02-01 11:45:51 +09:00
Yu Watanabe
a2a801926d sd-dhcp-server: refuse zero length client ID 2022-02-01 11:45:51 +09:00
Yu Watanabe
0a195d4186 sd-dhcp-server: do not log "STOPPED" when already stopped 2022-02-01 11:45:51 +09:00
Luca Boccassi
9d67fb0e33
Merge pull request #22175 from keszybz/kernel-install-mkosi-initrd
kernel-install: add support for KERNEL_INSTALL_INITRD_GENERATOR and KERNEL_INSTALL_STAGING_AREA
2022-01-31 23:09:46 +00:00
Frantisek Sumsal
e3d1ffcc48 network: s/confiured/configured/
A quick typo fix I noticed whilst debugging.
2022-01-31 23:07:41 +00:00
Lennart Poettering
69339ae9f7 tree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses 2022-01-31 23:07:19 +00:00
Lennart Poettering
e5b90b30c2 random-seed: add missing %m in error message 2022-01-31 21:07:13 +00:00
Frantisek Sumsal
caeaca1b8f
Merge pull request #22323 from mrc0mmand/fix-TEST-69-on-C8S
test: use ~/.bashrc instead of /etc/bash.bashrc
2022-01-31 19:04:02 +00:00
Lennart Poettering
594f64f466 update TODO 2022-01-31 18:14:34 +01:00
Frantisek Sumsal
6f73ef8b30 test: copy portable profiles into the image if they don't exist there
If we're built with `-Dportable=false`, the portable profiles won't get
installed into the image. Since we need only the profile files and
nothing else, let's copy them into the image explicitly in such case.
2022-01-31 17:09:30 +00:00
Frantisek Sumsal
1f450a680f test: use ~/.bashrc instead of /etc/bash.bashrc
/etc/bash.bashrc appears to be Debian-specific[0] (or specific to bash
versions compiled with -DSYS_BASHRC), which doesn't seem to be the case
for C8S. Let's use ~/.bashrc instead to make the CIs happy again.

[0] https://sources.debian.org/src/bash/5.1-6/debian/README/#L50-L56
2022-01-31 17:47:01 +01:00
Frantisek Sumsal
db357e9a89 test: make the code less error-prone 2022-01-31 16:49:09 +01:00
Luca Boccassi
187df3dd91
Merge pull request #22316 from yuwata/network-mac-address-length
network: several cleanups related to MAC address length
2022-01-31 14:21:28 +00:00
Luca Boccassi
0ec3af43f2
Merge pull request #22300 from yuwata/bus-fix-error-handling
tree-wide: fix bus method error handling
2022-01-31 14:03:00 +00:00
Daan De Meyer
17e2e8073f boot: Don't require a machine ID to be available
Regression introduced in https://github.com/systemd/systemd/pull/21807.

Fixes #22224
2022-01-31 13:58:06 +00:00
Luca Boccassi
06d4d83fa7
Merge pull request #22274 from yuwata/resolve-comment
resolve: cleanups for on_stream_io()
2022-01-31 13:56:04 +00:00
Luca Boccassi
9d6d4c305a core: don't fail on EEXIST when creating mount point
systemd[1016]: Failed to mount /tmp/app1 (type n/a) on /run/systemd/unit-extensions/1 (MS_BIND ): No such file or directory
systemd[1016]: Failed to create destination mount point node '/run/systemd/unit-extensions/1': File exists
2022-01-31 13:53:47 +01:00
Frantisek Sumsal
61b9769bda core: check argc/argv uncoditionally
as `assert()` might be dropped with `-DNDEBUG`.

Follow-up to cf3095a and 1637e75.
2022-01-31 20:00:40 +09:00
Yu Watanabe
256ce2e889
Merge pull request #21838 from lnussel/logind-refactor
Logind shutdown refactor
2022-01-31 19:45:33 +09:00
James Hilliard
e3759ac43a meson: use bpftool based strip when available
This should be useable in bpftool v5.13 or newer based on:
d80b2fcbe0
2022-01-31 16:42:07 +09:00
James Hilliard
408832e603 meson: set minimum clang/llvm versions for bpf support
The minimum clang/llvm-strip version needed for building libbpf based
programs is 10.0.0, this is documented here:
https://github.com/libbpf/libbpf/tree/v0.6.1#bpf-co-re-compile-once--run-everywhere

Using an older version such as 9.0.0 will generate objects that
bpftool will not be able to generate skeletons for.
2022-01-31 14:27:11 +09:00
Yu Watanabe
c565b65553 network: currently IPv4ACD requires MAC address whose length is ETH_ALEN 2022-01-31 13:10:28 +09:00
Yu Watanabe
218a850268 network: currently RADV requires MAC address whose length is ETH_ALEN 2022-01-31 13:10:28 +09:00
Yu Watanabe
f4ef1c196c network: disable NDisc for CAN interfaces
We already disabled DHCP clients for CAN interfaces.
2022-01-31 13:10:28 +09:00
Yu Watanabe
ba4c7184b3 network: configure NDisc after MAC address is assigned 2022-01-31 13:10:28 +09:00
Yu Watanabe
f42d41cc5f network: configure DHCP clients after MAC address is assigned
Prompted by #20090.
2022-01-31 13:10:28 +09:00
Frantisek Sumsal
bbe5371345 basic: update CIFS magic
Kernel commit dea2903719283c156b53741126228c4a1b40440f exposed (and
renamed) CIFS_MAGIC_NUMBER as CIFS_SUPER_MAGIC along with
SMB2_SUPER_MAGIC.

This fixes the following build fail on current Fedora Rawhide:
```
../src/basic/meson.build:389:8: ERROR: Problem encountered: found unknown filesystem(s) defined in kernel headers:

Filesystem found in kernel header but not in filesystems-gperf.gperf: CIFS_SUPER_MAGIC
Filesystem found in kernel header but not in filesystems-gperf.gperf: SMB2_SUPER_MAGIC
```
2022-01-31 11:50:15 +09:00
Dorian Clay
156d01b9ca
hwdb: add support for Surface Laptop 2 & 3 (#22303) 2022-01-31 04:50:09 +09:00
Davide Cavalca
7d75376e1f hwdb: add new database file for PDA devices
Add a new database for handhelds (PDAs, calculators, etc.) that should be
accessible the seat owner.

The database is initially populated with Texas Instruments calculators
and linking cables, which removes the need to installing dedicated udev
rules for them.
2022-01-31 04:46:38 +09:00
Donald Chan
a718364e9d basic: mac_[selinux,smack]_apply_fd does not work when applying labels
Commit a7fdc6c introduced a regression where file descriptors are opened
using O_PATH option. mac_smack_apply_fd() calls fsetxattr() and would fail
with a -EBADF (Bad file descriptor) error.

Use FORMAT_PROC_FD_PATH(fd) to convert the fd back into a full path and
call setxattr() or setfilecon() instead.

Signed-off-by: Donald Chan <hoiho@amazon.com>
2022-01-31 04:43:56 +09:00
Daan De Meyer
5b2d0f9efd shared: Handle filesystems that don't support hole punching in COPY_HOLES 2022-01-31 04:43:23 +09:00
Yu Watanabe
34905ff7a9
Merge pull request #22294 from evverx/fuzz-dhcp-client
tests: fuzz client_handle_offer
2022-01-31 04:41:07 +09:00
Frantisek Sumsal
15391a2245
Merge pull request #22302 from evverx/merge-oss-fuzz-corpora
ci: merge seed corpora with public OSS-Fuzz corpora on CFLite
2022-01-30 18:35:28 +00:00
Yu Watanabe
cf3095ac2b core: check if argc > 0 and argv[0] is set
Follow-up for 1637e75707.
2022-01-30 13:07:51 +00:00
Evgeny Vereshchagin
d38363b96b ci: no longer upload the latest builds on commits
The idea behind this action is to make it possible to compare the
latest fuzz targets with PRs to figure out whether bugs are really
reproducible in PRs only. Since forks (including systemd-stable) are
usually based on the upstream repository where almost all the bugs
are fixed before releases are cut it should be safe to assume that
if CFLite finds bugs in PRs they are most likely introduced in those
PRs.

It should probably be brought back once https://github.com/google/clusterfuzzlite/issues/84
is fixed.
2022-01-30 10:17:25 +00:00
Evgeny Vereshchagin
69aa4982bc ci: merge seed corpora with public OSS-Fuzz corpora on CFLite
to let it cover as much code as possible. It should help to catch
most regressions in a few minutes.
2022-01-30 10:17:25 +00:00
Frantisek Sumsal
1637e75707 shared: be extra paranoid and check if argc > 0
and also if argv[0] is non-empty as a precaution for issues similar to
CVE-2021-4034.
2022-01-30 17:53:10 +09:00
Yu Watanabe
b97f338e56
Merge pull request #22301 from mrc0mmand/cocci-tweaks
fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
2022-01-30 09:34:44 +09:00
Frantisek Sumsal
a79da8b3c7 test: make use of strv_isempty() 2022-01-29 22:36:29 +01:00
Frantisek Sumsal
ea1c9d3f69 fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa() 2022-01-29 22:34:02 +01:00
Yu Watanabe
80c8c786a3 login: use bus_error_message() at one more place 2022-01-30 05:43:56 +09:00
Yu Watanabe
3332218555 core/unit: use bus_error_message() at one more place 2022-01-30 05:43:56 +09:00
Yu Watanabe
853b94863c bus-util: retrieve bus error from message
The error in argument is not input, but used for output.
2022-01-30 05:43:56 +09:00
Evgeny Vereshchagin
e46c743a57 ci: update GHActions once a month
Apparently some actions like CodeQL are released a few times a week so let's
just update them once a month in one fell swoop.
2022-01-29 19:26:14 +00:00
Evgeny Vereshchagin
81f84a2c0b ci: use CFLite to test forks (including systemd-stable)
It's like CIFuzz but unlike CIFuzz it's compatible with forks and
it should make it possible to run the fuzzers to make sure that
patches backported to them are backported correctly without introducing
new bugs and regressions.
2022-01-29 18:37:17 +00:00
Evgeny Vereshchagin
9591c0a8b3 sd-dhcp-lease: fix a memory leak in dhcp_lease_parse_search_domains
=================================================================
==81071==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x51245c in __interceptor_reallocarray (/home/vagrant/systemd/build/fuzz-dhcp-client+0x51245c)
    #1 0x7f01440c67e6 in strv_push /home/vagrant/systemd/build/../src/basic/strv.c:435:13
    #2 0x7f01440ca9e1 in strv_consume /home/vagrant/systemd/build/../src/basic/strv.c:506:13
    #3 0x7f01440ca9e1 in strv_extend /home/vagrant/systemd/build/../src/basic/strv.c:558:16
    #4 0x5806e3 in dhcp_lease_parse_search_domains /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:900:21
    #5 0x57c1be in dhcp_lease_parse_options /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:727:21
    #6 0x572450 in parse_options /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:348:33
    #7 0x571c6a in dhcp_option_parse /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:376:13
    #8 0x559a01 in client_handle_offer /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-client.c:1543:13
    #9 0x5592bd in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/libsystemd-network/fuzz-dhcp-client.c:74:16
    #10 0x44a379 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a379)
    #11 0x42ae1f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x42ae1f)
    #12 0x432ade in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x432ade)
    #13 0x421f86 in main (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421f86)
    #14 0x7f0142fff55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
2022-01-29 03:19:53 +00:00
Evgeny Vereshchagin
998ec39b1d tests: add a file triggering a memory leak in dhcp_lease_parse_search_domains 2022-01-29 03:19:53 +00:00