aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "fstab-generator, core/mount: Avoid special fs target before dependency only if nofail is used"revert-20598-order_noautoLennart Poettering2022-01-312-2/+11
|
* update TODOLennart Poettering2022-01-311-0/+2
|
* test: copy portable profiles into the image if they don't exist thereFrantisek Sumsal2022-01-311-0/+11
| | | | | | 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.
* Merge pull request #22316 from yuwata/network-mac-address-lengthLuca Boccassi2022-01-3110-7/+114
|\ | | | | network: several cleanups related to MAC address length
| * network: currently IPv4ACD requires MAC address whose length is ETH_ALENYu Watanabe2022-01-311-3/+5
| |
| * network: currently RADV requires MAC address whose length is ETH_ALENYu Watanabe2022-01-311-0/+6
| |
| * network: disable NDisc for CAN interfacesYu Watanabe2022-01-311-0/+4
| | | | | | | | We already disabled DHCP clients for CAN interfaces.
| * network: configure NDisc after MAC address is assignedYu Watanabe2022-01-315-4/+82
| |
| * network: configure DHCP clients after MAC address is assignedYu Watanabe2022-01-313-0/+17
| | | | | | | | Prompted by #20090.
* | Merge pull request #22300 from yuwata/bus-fix-error-handlingLuca Boccassi2022-01-313-9/+21
|\ \ | | | | | | tree-wide: fix bus method error handling
| * | login: use bus_error_message() at one more placeYu Watanabe2022-01-301-3/+7
| | |
| * | core/unit: use bus_error_message() at one more placeYu Watanabe2022-01-301-2/+6
| | |
| * | bus-util: retrieve bus error from messageYu Watanabe2022-01-301-4/+8
| | | | | | | | | | | | The error in argument is not input, but used for output.
* | | boot: Don't require a machine ID to be availableDaan De Meyer2022-01-311-4/+7
| | | | | | | | | | | | | | | | | | Regression introduced in https://github.com/systemd/systemd/pull/21807. Fixes #22224
* | | Merge pull request #22274 from yuwata/resolve-commentLuca Boccassi2022-01-316-67/+81
|\ \ \ | | | | | | | | resolve: cleanups for on_stream_io()
| * | | resolve: llmnr: fix never hit conditionYu Watanabe2022-01-283-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the condition in on_stream_io_impl() never hit, as the read packet is always taken from the stream in the few lines above. Instead of the dns_stream_complete() under the condition, the stream is unref()ed in the on_packet callback for LLMNR stream, unlike the other on_packet callbacks. That's quite tricky. Also, potentially, the stream may still have queued packets to write. This fix the condition, and drops the unref() in the on_packet callback. C.f. https://github.com/systemd/systemd/pull/22274#issuecomment-1023708449. Closes #22266.
| * | | resolve: mention that dns_stream_update() needs to be called after dns_stream_take_read_packet()Yu Watanabe2022-01-281-0/+7
| | | | | | | | | | | | | | | | | | | | Based on the analysis by Joan Bruguera <joanbrugueram@gmail.com>. See https://github.com/systemd/systemd/pull/22132#discussion_r793951650.
| * | | resolve: call dns_stream_take_read_packet() in on_stream_io()Yu Watanabe2022-01-286-39/+31
| | | | | | | | | | | | | | | | | | | | As dns_stream_take_read_packet() is called only in on_packet callbacks, and all on_packet callbacks call it.
| * | | resolve: make dns_stream_new() take on_packet and complete callbacksYu Watanabe2022-01-286-23/+31
| | | | | | | | | | | | | | | | And make on_packet callback mandatory.
* | | | core: don't fail on EEXIST when creating mount pointLuca Boccassi2022-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* | | | core: check argc/argv uncoditionallyFrantisek Sumsal2022-01-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | as `assert()` might be dropped with `-DNDEBUG`. Follow-up to cf3095a and 1637e75.
* | | | Merge pull request #21838 from lnussel/logind-refactorYu Watanabe2022-01-3116-364/+539
|\ \ \ \ | | | | | | | | | | Logind shutdown refactor
| * | | | test: add shutdown testLudwig Nussel2022-01-255-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wraps nspawn to be able to use pexpect. The test logs in on the console and runs screen. In one screen window it types in shutdown commands and checks whether a wall message was sent to the other.
| * | | | systemctl: shutdown don't fallback on auth failLudwig Nussel2022-01-253-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For shutdowns don't fall back to starting the target directly if talking to logind failed with auth failure. That would just lead to another polkit auth attempt.
| * | | | logind: refactorLudwig Nussel2022-01-258-338/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid hardcoded strings and string compares related to shutdown actions. Instead put everything into a common structure. Reuse existing HandleAction as index since it's already exposed as property for the button handlers.
| * | | | logind: require polkit auth for cancelling shutdownsLudwig Nussel2022-01-251-2/+32
| | | | |
| * | | | logind: fix wall messages for direct shutdown callsLudwig Nussel2022-01-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wall mechanism uses the scheduled_shutdown_type to determine what message to send so it needs to be filled in also for the cases that call for shutdown without schedule. It's really a hackish way. The overall code needs refacturing.
| * | | | logind: enable wall messages by defaultLudwig Nussel2022-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Something calling directly into the dbus interface to request a shutdown may not bother turning wall messages on explicitly. This has the convenient side effect that no separate polkit auth is required to turn on wall messages. Was annoying as having a wall message is the default behavior of the commandline tools. Now it's the other way around ie eg systemctl reboot --no-wall requires auth to explicitly turn off the wall message.
| * | | | systemctl: simplify halt_main()Ludwig Nussel2022-01-251-28/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code at this point is not able to tell whether it was called as halt/poweroff/reboot or shutdown with time "now". The code also takes a shortcut to skip logind if called as root. That however means asking shutdown for immediate action won't trigger a wall message. As per https://github.com/systemd/systemd/issues/8424#issuecomment-374677315 all commands should trigger a wall message. That simplifies the code as we can try logind first always.
| * | | | logind: fix wall message for immediate shutdownsLudwig Nussel2022-01-252-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | An elapse time of zero means NOW which should trigger a wall message.
* | | | | meson: use bpftool based strip when availableJames Hilliard2022-01-312-18/+40
| | | | | | | | | | | | | | | | | | | | | | | | | This should be useable in bpftool v5.13 or newer based on: https://github.com/torvalds/linux/commit/d80b2fcbe0a023619e0fc73112f2a02c2662f6ab
* | | | | meson: set minimum clang/llvm versions for bpf supportJames Hilliard2022-01-311-2/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | basic: update CIFS magicFrantisek Sumsal2022-01-312-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | | | hwdb: add support for Surface Laptop 2 & 3 (#22303)Dorian Clay2022-01-311-0/+18
| | | |
* | | | hwdb: add new database file for PDA devicesDavide Cavalca2022-01-313-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | basic: mac_[selinux,smack]_apply_fd does not work when applying labelsDonald Chan2022-01-312-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | shared: Handle filesystems that don't support hole punching in COPY_HOLESDaan De Meyer2022-01-311-2/+4
| | | |
* | | | Merge pull request #22294 from evverx/fuzz-dhcp-clientYu Watanabe2022-01-315-5/+86
|\ \ \ \ | | | | | | | | | | tests: fuzz client_handle_offer
| * | | | sd-dhcp-lease: fix a memory leak in dhcp_lease_parse_search_domainsEvgeny Vereshchagin2022-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ================================================================= ==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)
| * | | | tests: add a file triggering a memory leak in dhcp_lease_parse_search_domainsEvgeny Vereshchagin2022-01-291-0/+0
| | | | |
| * | | | sd-dhcp-lease: fix an infinite loop found by the fuzzerEvgeny Vereshchagin2022-01-291-4/+2
| | | | |
| * | | | tests: fuzz client_handle_offerEvgeny Vereshchagin2022-01-293-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that part of systemd isn't covered by any fuzz targets and that's not ideal considering that it parses data sent remotely. The fuzzer triggers an infinite loop in lease_parse_routes as soon as it starts so it seems to be working :-) ``` INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 23620602 INFO: Loaded 2 modules (182073 inline 8-bit counters): 176548 [0x7fdf511fc8d0, 0x7fdf51227a74), 5525 [0x5f6ef0, 0x5f8485), INFO: Loaded 2 PC tables (182073 PCs): 176548 [0x7fdf51227a78,0x7fdf514d94b8), 5525 [0x5f8488,0x60ddd8), ./build/fuzz-dhcp-client: Running 1 inputs 1 time(s) each. Running: test/fuzz/fuzz-dhcp-client/timeout-ed34161922c7075c4773f2ada3dee8685d220980 ALARM: working on the last Unit for 31 seconds and the timeout value is 30 (use -timeout=N to change) ==80731== ERROR: libFuzzer: timeout after 31 seconds #0 0x51b32e in __sanitizer_print_stack_trace (/home/vagrant/systemd/build/fuzz-dhcp-client+0x51b32e) #1 0x4689e9 in fuzzer::PrintStackTrace() (/home/vagrant/systemd/build/fuzz-dhcp-client+0x4689e9) #2 0x44a0f4 in fuzzer::Fuzzer::StaticAlarmCallback() (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a0f4) #3 0x7fdf4f8b474f (/lib64/libc.so.6+0x4274f) #4 0x465fee in __sanitizer_cov_trace_const_cmp4 (/home/vagrant/systemd/build/fuzz-dhcp-client+0x465fee) #5 0x57eee5 in lease_parse_routes /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:495:23 #6 0x57baf3 in dhcp_lease_parse_options /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:701:21 #7 0x572450 in parse_options /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:348:33 #8 0x571cea in dhcp_option_parse /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:381:21 #9 0x559a01 in client_handle_offer /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-client.c:1543:13 #10 0x5592bd in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/libsystemd-network/fuzz-dhcp-client.c:78:9 #11 0x44a379 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a379) #12 0x42ae1f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x42ae1f) #13 0x432ade in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x432ade) #14 0x421f86 in main (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421f86) #15 0x7fdf4f89f55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #16 0x7fdf4f89f60b in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b) #17 0x421fd4 in _start (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421fd4) SUMMARY: libFuzzer: timeout ```
* | | | | Merge pull request #22302 from evverx/merge-oss-fuzz-corporaFrantisek Sumsal2022-01-303-32/+14
|\ \ \ \ \ | | | | | | | | | | | | ci: merge seed corpora with public OSS-Fuzz corpora on CFLite
| * | | | | ci: no longer upload the latest builds on commitsEvgeny Vereshchagin2022-01-301-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | ci: merge seed corpora with public OSS-Fuzz corpora on CFLiteEvgeny Vereshchagin2022-01-302-1/+14
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | to let it cover as much code as possible. It should help to catch most regressions in a few minutes.
* | | | | core: check if argc > 0 and argv[0] is setYu Watanabe2022-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | Follow-up for 1637e757070a61b12b26a2a4ef547330562dc77f.
* | | | | shared: be extra paranoid and check if argc > 0Frantisek Sumsal2022-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | and also if argv[0] is non-empty as a precaution for issues similar to CVE-2021-4034.
* | | | | Merge pull request #22301 from mrc0mmand/cocci-tweaksYu Watanabe2022-01-302-3/+3
|\ \ \ \ \ | |/ / / / |/| | | | fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
| * | | | test: make use of strv_isempty()Frantisek Sumsal2022-01-291-1/+1
| | | | |
| * | | | fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()Frantisek Sumsal2022-01-291-2/+2
|/ / / /