]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agosd-dhcp6-client: disable event source when client is stopped or freed
Yu Watanabe [Sun, 6 Feb 2022 13:35:17 +0000 (22:35 +0900)] 
sd-dhcp6-client: disable event source when client is stopped or freed

3 years agosd-dhcp6-client: use in6_addr_to_string()
Yu Watanabe [Sun, 6 Feb 2022 13:34:04 +0000 (22:34 +0900)] 
sd-dhcp6-client: use in6_addr_to_string()

3 years agosd-dhcp6-client: stop client on error in client state transition
Yu Watanabe [Sun, 6 Feb 2022 13:22:38 +0000 (22:22 +0900)] 
sd-dhcp6-client: stop client on error in client state transition

3 years agosd-dhcp6-client: add missing one more error handling
Yu Watanabe [Sun, 6 Feb 2022 13:17:43 +0000 (22:17 +0900)] 
sd-dhcp6-client: add missing one more error handling

3 years agosd-dhcp6-client: rename client_start() -> client_set_state()
Yu Watanabe [Sun, 6 Feb 2022 13:16:17 +0000 (22:16 +0900)] 
sd-dhcp6-client: rename client_start() -> client_set_state()

3 years agosd-dhcp6-client: introduce client_process_*()
Yu Watanabe [Sun, 6 Feb 2022 12:59:07 +0000 (21:59 +0900)] 
sd-dhcp6-client: introduce client_process_*()

This is mostly for shortening `client_receive_message()`.

This also fixes the following:
- do not trigger SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST notification
  when non-reply message,
- add several missing error handlings caused in client_start().

3 years agosd-dhcp6-client: fix possible unaligned read or write
Yu Watanabe [Sun, 6 Feb 2022 11:53:34 +0000 (20:53 +0900)] 
sd-dhcp6-client: fix possible unaligned read or write

3 years agosd-dhcp6-client: voidify client_reset()
Yu Watanabe [Sun, 6 Feb 2022 10:42:58 +0000 (19:42 +0900)] 
sd-dhcp6-client: voidify client_reset()

3 years agosd-dhcp6-client: introduce dhcp6_lease_new_from_message()
Yu Watanabe [Sun, 6 Feb 2022 10:36:30 +0000 (19:36 +0900)] 
sd-dhcp6-client: introduce dhcp6_lease_new_from_message()

3 years agosd-dhcp6-client: use structured initializer
Yu Watanabe [Sun, 6 Feb 2022 09:24:13 +0000 (18:24 +0900)] 
sd-dhcp6-client: use structured initializer

3 years agosd-dhcp6-lease: unify lease lifetime calculation
Yu Watanabe [Sun, 6 Feb 2022 07:12:10 +0000 (16:12 +0900)] 
sd-dhcp6-lease: unify lease lifetime calculation

3 years agosd-dhcp6-client: always use ENODATA when a lease does not have requested data
Yu Watanabe [Sun, 6 Feb 2022 06:01:47 +0000 (15:01 +0900)] 
sd-dhcp6-client: always use ENODATA when a lease does not have requested data

3 years agosd-dhcp6-client: unify dhcp6_option_append_{ia,pd}()
Yu Watanabe [Sun, 6 Feb 2022 05:56:59 +0000 (14:56 +0900)] 
sd-dhcp6-client: unify dhcp6_option_append_{ia,pd}()

3 years agosd-dhcp6-client: store PD prefix hint in ia_pd
Yu Watanabe [Sun, 6 Feb 2022 05:32:36 +0000 (14:32 +0900)] 
sd-dhcp6-client: store PD prefix hint in ia_pd

And allows to specify multiple hints.

3 years agosd-dhcp6-client: introduce dhcp6_ia_free()
Yu Watanabe [Sun, 6 Feb 2022 05:18:44 +0000 (14:18 +0900)] 
sd-dhcp6-client: introduce dhcp6_ia_free()

3 years agosd-dhcp6-client: unify IA option header
Yu Watanabe [Sun, 6 Feb 2022 04:38:08 +0000 (13:38 +0900)] 
sd-dhcp6-client: unify IA option header

This also fixes possible unaligned read of message.

3 years agosd-dhcp6-lease: reset client or server ID when length is zero
Yu Watanabe [Fri, 4 Feb 2022 01:45:40 +0000 (10:45 +0900)] 
sd-dhcp6-lease: reset client or server ID when length is zero

Addresses https://github.com/systemd/systemd/pull/22406#issuecomment-1029391091.

3 years agosd-dhcp6-lease: convert assert_return() -> assert() in non-public functions
Yu Watanabe [Fri, 4 Feb 2022 01:40:33 +0000 (10:40 +0900)] 
sd-dhcp6-lease: convert assert_return() -> assert() in non-public functions

3 years agosd-dhcp6-client: rename ia -> ia_na, pd -> ia_pd in sd_dhcp6_lease
Yu Watanabe [Fri, 4 Feb 2022 01:17:44 +0000 (10:17 +0900)] 
sd-dhcp6-client: rename ia -> ia_na, pd -> ia_pd in sd_dhcp6_lease

The previous naming is quite misleading.

3 years agosd-dhcp6-client: fix typo ia_pd -> ia_na
Yu Watanabe [Fri, 4 Feb 2022 01:15:49 +0000 (10:15 +0900)] 
sd-dhcp6-client: fix typo ia_pd -> ia_na

Fortunately, currently both ia_pd and ia_na in sd_dhcp6_client are
equivalent now.

3 years agosd-dhcp6-client: introduce two helpers to create message
Yu Watanabe [Sat, 5 Feb 2022 05:19:59 +0000 (14:19 +0900)] 
sd-dhcp6-client: introduce two helpers to create message

3 years agosd-dhcp6-client: trigger assertion whn invalid IA type is provided
Yu Watanabe [Sat, 5 Feb 2022 05:29:33 +0000 (14:29 +0900)] 
sd-dhcp6-client: trigger assertion whn invalid IA type is provided

If the condition hits, then it is an error in coding, instead of a user
misconfiguration or invalid receivd message.

3 years agosd-dhcp6-client: add missing address existence check
Yu Watanabe [Sat, 5 Feb 2022 05:24:42 +0000 (14:24 +0900)] 
sd-dhcp6-client: add missing address existence check

This adds similar check as 58da18251f468de9de4cc7b36804c924e2fd4421.

3 years agoMerge pull request #22471 from yuwata/network-bridge-vlan-protocol
Yu Watanabe [Thu, 10 Feb 2022 11:40:04 +0000 (20:40 +0900)] 
Merge pull request #22471 from yuwata/network-bridge-vlan-protocol

network: bridge: fix vlan protocol

3 years agoMerge pull request #22452 from yuwata/network-ipv6ll
Yu Watanabe [Thu, 10 Feb 2022 11:38:56 +0000 (20:38 +0900)] 
Merge pull request #22452 from yuwata/network-ipv6ll

network: use sysctl to set IPv6LL address generation mode when the interface is already up

3 years agotest-network: add missing tests for bridge properties 22471/head
Yu Watanabe [Thu, 10 Feb 2022 09:04:34 +0000 (18:04 +0900)] 
test-network: add missing tests for bridge properties

3 years agonetwork: bridge: fix endian of vlan protocol
Yu Watanabe [Thu, 10 Feb 2022 08:47:14 +0000 (17:47 +0900)] 
network: bridge: fix endian of vlan protocol

Fixes #22469.

3 years agotest-network: add testcase for re-generating IPv6LL address 22452/head
Yu Watanabe [Tue, 8 Feb 2022 14:53:43 +0000 (23:53 +0900)] 
test-network: add testcase for re-generating IPv6LL address

3 years agonetwork: attempt to trigger kernel IPv6LL address generation
Joerie de Gram [Tue, 8 Feb 2022 13:56:26 +0000 (22:56 +0900)] 
network: attempt to trigger kernel IPv6LL address generation

Try to ensure kernel IPv6 link local address generation occurs by
setting the per-if addr_gen_mode sysctl when the link is already up,
instead of the netlink interface (IFLA_INET6_ADDR_GEN_MODE).

The netlink setting is sufficient in cases where the interface is not
yet up when networkd configures an interface - bringing the interface
up will trigger in-kernel address generation.

If the interface is already up, yet the interface has no IPv6LL assigned
setting IFLA_INET6_ADDR_GEN_MODE has no effect.

Writing the addr_gen_mode sysctl is a best effort attempt at triggering
address generation regardless of interface state because it also works
in cases where the interface is already up.

Fixes #22424.

3 years agonetwork: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c
Yu Watanabe [Tue, 8 Feb 2022 13:53:33 +0000 (22:53 +0900)] 
network: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c

3 years agonetwork: skip to set IPv6LL address generation mode if the requested mode is already set
Yu Watanabe [Tue, 8 Feb 2022 13:27:17 +0000 (22:27 +0900)] 
network: skip to set IPv6LL address generation mode if the requested mode is already set

3 years agonetwork: use log_link_warning_errno() or friends where applicable
Yu Watanabe [Tue, 8 Feb 2022 17:14:12 +0000 (02:14 +0900)] 
network: use log_link_warning_errno() or friends where applicable

3 years agonetwork: monitor current IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:26:23 +0000 (22:26 +0900)] 
network: monitor current IPv6LL address generation mode

3 years agonetwork: introduce two helper functions for setting IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:16:38 +0000 (22:16 +0900)] 
network: introduce two helper functions for setting IPv6LL address generation mode

3 years agoudev/net: support Match.Firmware= in .link files (#22462)
Alvin Šipraga [Thu, 10 Feb 2022 07:19:28 +0000 (08:19 +0100)] 
udev/net: support Match.Firmware= in .link files (#22462)

In cbcdcaaa0ec5 ("Add support for conditions on the machines firmware")
a new Firmware= directive was added for .netdev and .network files.
While it was also documented to work on .link files, in actual fact the
support was missing. Add that one extra line to make it work, and also
update the fuzzer directives.

3 years agoMerge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation
Anita Zhang [Thu, 10 Feb 2022 01:10:06 +0000 (17:10 -0800)] 
Merge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation

test: lvm 2.03.15 dropped the static autoactivation

3 years agotest: lvm 2.03.15 dropped the static autoactivation 22467/head
Frantisek Sumsal [Wed, 9 Feb 2022 21:35:03 +0000 (22:35 +0100)] 
test: lvm 2.03.15 dropped the static autoactivation

so install the respective generator only if we're running with older
lvm versions.

See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c

3 years agoClarify protocol used in systemd-journal-upload (#22465)
Federico Ceratto [Wed, 9 Feb 2022 20:34:29 +0000 (20:34 +0000)] 
Clarify protocol used in systemd-journal-upload (#22465)

* Clarify protocol used in systemd-journal-upload

3 years agoMerge pull request #22458 from poettering/parse-safe-string
Luca Boccassi [Wed, 9 Feb 2022 16:59:14 +0000 (16:59 +0000)] 
Merge pull request #22458 from poettering/parse-safe-string

some safety tweaks to conf-parser.[ch]

3 years agomeson: disable export-dbus-interfaces target when cross-compiling
Luca Boccassi [Tue, 8 Feb 2022 13:19:52 +0000 (13:19 +0000)] 
meson: disable export-dbus-interfaces target when cross-compiling

ERROR:
Cannot use target systemd as a generator because it is built for the
host machine and no exe wrapper is defined or needs_exe_wrapper is
true. You might want to set `native: true` instead to build it for
the build machine.

3 years agoci: remove MULTI_STATUS from superlinter
Evgeny Vereshchagin [Tue, 8 Feb 2022 20:35:17 +0000 (20:35 +0000)] 
ci: remove MULTI_STATUS from superlinter

Judging by
ERROR! Failed to call GitHub Status API!

it doesn't seem to work. Even if it did it would just clutter the status
checks I think so let's just remove MULTI_STATUS along with
GITHUB_TOKEN.

3 years agoMerge pull request #22248 from yuwata/network-tc-use-request-queue
Yu Watanabe [Wed, 9 Feb 2022 09:57:37 +0000 (18:57 +0900)] 
Merge pull request #22248 from yuwata/network-tc-use-request-queue

network: tc: use request queue to configure QDisc or TClass

3 years agoconf-parser: add specific parser for PID values 22458/head
Lennart Poettering [Wed, 9 Feb 2022 09:13:59 +0000 (10:13 +0100)] 
conf-parser: add specific parser for PID values

3 years agotree-wide: use config_parse_safe_string() at various places
Lennart Poettering [Wed, 9 Feb 2022 09:07:17 +0000 (10:07 +0100)] 
tree-wide: use config_parse_safe_string() at various places

3 years agoconf-parser: update config_item_*_lookup() to follow modern coding style
Lennart Poettering [Wed, 9 Feb 2022 08:55:21 +0000 (09:55 +0100)] 
conf-parser: update config_item_*_lookup() to follow modern coding style

Let's rename the return parameters ret_xyz, and always initialize them
if we return >= 0, as per our current coding style.

3 years agoconf-parser: refuse section headers with control characters early, just in case
Lennart Poettering [Wed, 9 Feb 2022 08:47:53 +0000 (09:47 +0100)] 
conf-parser: refuse section headers with control characters early, just in case

3 years agoconf-parser: minor refactorings/modernizations
Lennart Poettering [Wed, 9 Feb 2022 08:47:50 +0000 (09:47 +0100)] 
conf-parser: minor refactorings/modernizations

3 years agoconf-parser: use _cleanup_free_ where appropriate
Lennart Poettering [Wed, 9 Feb 2022 08:47:10 +0000 (09:47 +0100)] 
conf-parser: use _cleanup_free_ where appropriate

3 years agoconf-parse: add generic config_parse_safe_string() helper
Lennart Poettering [Wed, 9 Feb 2022 08:45:12 +0000 (09:45 +0100)] 
conf-parse: add generic config_parse_safe_string() helper

This helper is just like config_parse_string() but does some superficial
checks for control characters and quotes.

In most cases we currently use config_parse_string() we probably want to
use config_parse_safe_string() for safety reasons.

3 years agoAdd support for `isolated` parameter
Santa Wiryaman [Mon, 3 May 2021 22:48:26 +0000 (18:48 -0400)] 
Add support for `isolated` parameter

Add the "Isolated" parameter in the *.network file, e.g.,

[Bridge]
Isolated=true|false

When the Isolated parameter is true, traffic coming out of this port
will only be forward to other ports whose Isolated parameter is false.

When Isolated is not specified, the port uses the kernel default
setting (false).

The "Isolated" parameter was introduced in Linux 4.19.
See man bridge(8) for more details.
But even though the kernel and bridge/iproute2 recognize the "Isolated"
parameter, systemd-networkd did not have a way to set it.

3 years agoci: validate actions and fix actionlint warnings
Evgeny Vereshchagin [Tue, 8 Feb 2022 17:34:10 +0000 (17:34 +0000)] 
ci: validate actions and fix actionlint warnings

some actions like Coverity and CFLite aren't run on every PR so to make
sure they are more or less fine when they are changed it makes sense to
at least check them with superlinter/actionlint: https://github.com/rhysd/actionlint

The following warnings were fixed along the way:
```
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2046:warning:6:40: Quote this to prevent word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2006:style:6:40: Use $(...) notation instead of legacy backticked `...` [shellcheck]
   |
55 |       run: |
   |       ^~~~
```
```
.github/workflows/coverity.yml:31:9: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
   |
31 |         run: echo "COVERITY_SCAN_NOTIFICATION_EMAIL=$(git log -1 ${{ github.sha }} --pretty=\"%aE\")" >> $GITHUB_ENV
   |         ^~~~
```

3 years agonetwork: tc: use hashmap to store traffic control settings in .network files 22248/head
Yu Watanabe [Wed, 26 Jan 2022 04:06:37 +0000 (13:06 +0900)] 
network: tc: use hashmap to store traffic control settings in .network files

As now each qdisc or tclass is configured when it is ready.

3 years agonetwork: tc: introduce order dependency of traffic control
Yu Watanabe [Wed, 26 Jan 2022 04:01:19 +0000 (13:01 +0900)] 
network: tc: introduce order dependency of traffic control

3 years agonetwork: tc: use request queue to configure traffic control
Yu Watanabe [Tue, 25 Jan 2022 18:49:27 +0000 (03:49 +0900)] 
network: tc: use request queue to configure traffic control

But no dependency resolution is implemented.

3 years agonetwork: tc/teql: set tca_kind in verify()
Yu Watanabe [Wed, 26 Jan 2022 03:18:47 +0000 (12:18 +0900)] 
network: tc/teql: set tca_kind in verify()

Then, qdisc_configure() can be simplified.

3 years agonetwork: tc: monitor qdisc and tclass
Yu Watanabe [Tue, 25 Jan 2022 23:42:22 +0000 (08:42 +0900)] 
network: tc: monitor qdisc and tclass

3 years agosd-netlink: allow to dump qdisc and tclass
Yu Watanabe [Wed, 26 Jan 2022 01:24:50 +0000 (10:24 +0900)] 
sd-netlink: allow to dump qdisc and tclass

3 years agosd-netlink: make traffic control related message can be monitored
Yu Watanabe [Wed, 26 Jan 2022 00:53:40 +0000 (09:53 +0900)] 
sd-netlink: make traffic control related message can be monitored

3 years agosd-netlink: introduce sd_rtnl_message_traffic_control_get_{ifindex,parent,handle}()
Yu Watanabe [Tue, 25 Jan 2022 21:04:16 +0000 (06:04 +0900)] 
sd-netlink: introduce sd_rtnl_message_traffic_control_get_{ifindex,parent,handle}()

3 years agosd-netlink: unify sd_rtnl_message_new_qdisc() and sd_rtnl_message_new_tclass()
Yu Watanabe [Tue, 25 Jan 2022 21:00:55 +0000 (06:00 +0900)] 
sd-netlink: unify sd_rtnl_message_new_qdisc() and sd_rtnl_message_new_tclass()

As the netlink message header types for both qdisc and tclass are
equivalent.

3 years agonetwork: coding style fixes
Yu Watanabe [Wed, 26 Jan 2022 05:28:17 +0000 (14:28 +0900)] 
network: coding style fixes

3 years agonetwork: tc: drop unnecessary conditions
Yu Watanabe [Tue, 25 Jan 2022 21:42:23 +0000 (06:42 +0900)] 
network: tc: drop unnecessary conditions

As TC_H_UNSPEC is 0.

3 years agonetwork: tc: drop unused QDisc::family element
Yu Watanabe [Tue, 25 Jan 2022 20:52:54 +0000 (05:52 +0900)] 
network: tc: drop unused QDisc::family element

3 years agoUpdate footer.html
Eduard Tolosa [Thu, 3 Feb 2022 18:25:57 +0000 (13:25 -0500)] 
Update footer.html

3 years agoMerge pull request #22446 from poettering/sd-boot-cpuid-vm-tscd
Lennart Poettering [Tue, 8 Feb 2022 20:57:38 +0000 (21:57 +0100)] 
Merge pull request #22446 from poettering/sd-boot-cpuid-vm-tscd

sd-boot: don't read TSC in VM environments, and other TSC fixes

3 years agonetwork: move ipv6ll related functions to networkd-ipv6ll.[ch]
Yu Watanabe [Tue, 8 Feb 2022 12:56:02 +0000 (21:56 +0900)] 
network: move ipv6ll related functions to networkd-ipv6ll.[ch]

3 years agoMerge pull request #22448 from poettering/coredump-raise-sizes
Yu Watanabe [Tue, 8 Feb 2022 16:23:07 +0000 (01:23 +0900)] 
Merge pull request #22448 from poettering/coredump-raise-sizes

coredump: raise limits

3 years agoRevert "ci: switch to fedora-35 on i386 on Packit"
Yu Watanabe [Sat, 22 Jan 2022 18:07:52 +0000 (03:07 +0900)] 
Revert "ci: switch to fedora-35 on i386 on Packit"

This reverts commit 478c632e00ffbf50012b1946a8a025494c012353.

3 years agoRevert "packit: switch the remaining jobs to F35"
Yu Watanabe [Sat, 22 Jan 2022 18:07:18 +0000 (03:07 +0900)] 
Revert "packit: switch the remaining jobs to F35"

This reverts commit e7642152ae6e867fc569206e905464321a41e58a.

3 years agoudev/net: support to set MDI-X mode
Yu Watanabe [Fri, 4 Feb 2022 04:06:27 +0000 (13:06 +0900)] 
udev/net: support to set MDI-X mode

Closes #22386.

3 years agoMerge pull request #22423 from poettering/repart-sector-size
Lennart Poettering [Tue, 8 Feb 2022 13:47:00 +0000 (14:47 +0100)] 
Merge pull request #22423 from poettering/repart-sector-size

repart: fix sector size handling

3 years agowatchdog: saturate to kernel's max watchdog timeout
Curtis Klein [Sun, 10 Oct 2021 01:18:54 +0000 (18:18 -0700)] 
watchdog: saturate to kernel's max watchdog timeout

Since version 4.5, the max possible timeout is UINT_MAX / 1000 since it
does calculations in milliseconds. A small helper function is added to
make this conversion and saturation and will be used more in the next
commit.

Also document the usage of signed integers by the kernel userspace API.

3 years agoMerge pull request #22442 from DaanDeMeyer/fix-entry-iteration
Lennart Poettering [Tue, 8 Feb 2022 13:29:24 +0000 (14:29 +0100)] 
Merge pull request #22442 from DaanDeMeyer/fix-entry-iteration

journal: Fix entry array iteration in case of corruption

3 years agoMerge pull request #22366 from poettering/journal-file-punch-fix
Daan De Meyer [Tue, 8 Feb 2022 13:03:03 +0000 (13:03 +0000)] 
Merge pull request #22366 from poettering/journal-file-punch-fix

journald: some journal file hole punching fixes

3 years agosd-boot: don't use TSC in virtualized environments 22446/head
Lennart Poettering [Tue, 8 Feb 2022 10:35:10 +0000 (11:35 +0100)] 
sd-boot: don't use TSC in virtualized environments

Replaces: f699bd81e8e18da2d2fc11e7fb7dce95f8bb3f9e

Fixes: #22060
3 years agosd-boot: return 0 (not 1) from ticks_read() in fallback implementation
Lennart Poettering [Tue, 8 Feb 2022 10:27:48 +0000 (11:27 +0100)] 
sd-boot: return 0 (not 1) from ticks_read() in fallback implementation

The single consumer of ticks_read() (i.e. time_usec()) checks for == 0
to detect the "not supported/invalid" case, hence actually return the
right value for that.

3 years agosd-boot: encapsulate freq cache in ticks_freq()
Lennart Poettering [Tue, 8 Feb 2022 10:26:49 +0000 (11:26 +0100)] 
sd-boot: encapsulate freq cache in ticks_freq()

It's usually nicer to abstract a cache away in the provider of a value,
hence do so.

3 years agosd-boot: don't export ticks_read() and ticks_freq()
Lennart Poettering [Tue, 8 Feb 2022 10:25:07 +0000 (11:25 +0100)] 
sd-boot: don't export ticks_read() and ticks_freq()

They only have a single user in time_usec(), hence don't expose them.

3 years agosd-boot: add overflow check to TSC reads
Lennart Poettering [Tue, 8 Feb 2022 10:23:19 +0000 (11:23 +0100)] 
sd-boot: add overflow check to TSC reads

On some archs the counter is 32bit, and in case of virtualization it
might actually overflow, who knows.

3 years agosd-boot: split out TSC/time API
Lennart Poettering [Tue, 8 Feb 2022 10:18:44 +0000 (11:18 +0100)] 
sd-boot: split out TSC/time API

These are a whole family of functions, let's give them their own .c/.h
file.

No code changes, just splitting things out.

3 years agoRevert "boot-timestamps: Discard firmware init time when running in a VM"
Lennart Poettering [Thu, 3 Feb 2022 11:06:54 +0000 (12:06 +0100)] 
Revert "boot-timestamps: Discard firmware init time when running in a VM"

This reverts commit f699bd81e8e18da2d2fc11e7fb7dce95f8bb3f9e (#22063)

We should suppress the TSC data when we generate it if we assume its
invalid, not when we consume it, because at that point we don't even
know if the data stems from TSC or something else.

3 years agodocs: Improve HOME_DIRECTORY.md
adrian5 [Tue, 8 Feb 2022 11:42:19 +0000 (12:42 +0100)] 
docs: Improve HOME_DIRECTORY.md

3 years agoMerge pull request #22430 from yuwata/resolve-fix-memleak-and-use-after-free
Luca Boccassi [Tue, 8 Feb 2022 12:01:14 +0000 (12:01 +0000)] 
Merge pull request #22430 from yuwata/resolve-fix-memleak-and-use-after-free

resolve: fix memleak and use-after-free, and several cleanups

3 years agoman: coredump.conf: document defaults limits 22448/head
Lennart Poettering [Tue, 8 Feb 2022 10:54:37 +0000 (11:54 +0100)] 
man: coredump.conf: document defaults limits

3 years agocoredump: raise the coredump save size on 64bit systems to 32G (and lower it to 1G...
Lennart Poettering [Tue, 8 Feb 2022 10:52:17 +0000 (11:52 +0100)] 
coredump: raise the coredump save size on 64bit systems to 32G (and lower it to 1G on 32bit systems)

Apparently 2G is too low for various real-life systems. But raising it
universally above 2^32 sounds wrong to me, since that makes no sense on
32bit systems, that we still support.

Hence, let's raise the limit to 32G on 64bit systems, and *lower* it to
1G on 32bit systems.

32G is 4 orders of magnitude higher then the old settings. Let's hope
that's enough for now. Should this not be enough we can raise it
further.

Fixes: #22076
3 years agoREADME: CONFIG_KCMP is the new kernel compile time option for kcmp()
Lennart Poettering [Tue, 8 Feb 2022 10:45:00 +0000 (11:45 +0100)] 
README: CONFIG_KCMP is the new kernel compile time option for kcmp()

Fixes: #21947
3 years agotests: add repart tests for block devices with 1024, 2048, 4096 byte sector sizes 22423/head
Lennart Poettering [Mon, 7 Feb 2022 13:35:40 +0000 (14:35 +0100)] 
tests: add repart tests for block devices with 1024, 2048, 4096 byte sector sizes

let's make sure repart works with 4K drives and exotic sector sizes.

3 years agorepart: fix sector size handling
Lennart Poettering [Fri, 4 Feb 2022 16:39:44 +0000 (17:39 +0100)] 
repart: fix sector size handling

This queries the sector size from libfdisk instead of assuming 512, and
uses that when converting from bytes to the offset/size values libfdisk
expects.

This is an alternative to Tom Yan's #21823, but prefers using libfdisk's
own ideas of the sector size instead of going directly to the backing
device via ioctls. (libfdisk can after all also operate on regular
files, where the sector size concept doesn't necessarily apply the same
way.)

This also makes the "grain" variable, i.e. how we'll align the
partitions. Previously this was hardcoded to 4K, and that still will be
the minimum grain we use, but should the sector size be larger than that
we'll use the next multiple of the sector size instead.

3 years agoresolve: reuse timer event source for DnsQuery 22430/head
Yu Watanabe [Sat, 5 Feb 2022 13:31:06 +0000 (22:31 +0900)] 
resolve: reuse timer event source for DnsQuery

If the query get CNAME or DNAME, then the query will be restarted.
Even in that case, previously, the event source was freed and allocated
again. Let's slightly optimize it.

3 years agoresolve: use _cleanup_ attribute for freeing DnsQuery
Yu Watanabe [Sat, 5 Feb 2022 13:04:42 +0000 (22:04 +0900)] 
resolve: use _cleanup_ attribute for freeing DnsQuery

3 years agoresolve: fix possible memleak
Yu Watanabe [Sat, 5 Feb 2022 13:03:19 +0000 (22:03 +0900)] 
resolve: fix possible memleak

Fortunately, unlike the issue fixed in the previous commit, the memleak
should be superficial and not become apparent, as the queries handled
here are managed by the stub stream, and will be freed when the stream
is closed.

Just for safety, and slightly reducing the runtime memory usage by the
stub stream.

3 years agoresolve: fix potential memleak and use-after-free
Yu Watanabe [Sat, 5 Feb 2022 12:37:01 +0000 (21:37 +0900)] 
resolve: fix potential memleak and use-after-free

When stub stream is closed early, then queries associated to the stream
are freed. Previously, the timer event source for queries may not be
disabled, hence may be triggered with already freed query.
See also dns_stub_stream_complete().

Note that we usually not set NULL or zero when freeing simple objects.
But, here DnsQuery is large and complicated object, and the element may
be referenced in subsequent freeing process in the future. Hence, for
safety, let's set NULL to the pointer.

3 years agohwbd: 60-sensor.hwdb: Add Pipo W2Pro
Matt Walton [Fri, 4 Feb 2022 17:47:08 +0000 (11:47 -0600)] 
hwbd: 60-sensor.hwdb: Add Pipo W2Pro

Add accelerometer matrix for Pipo W2Pro tablet. Y-axis was backwards (normal <--> bottom-up).

3 years agooom: Cleanup of information dump code after kill
Benjamin Berg [Mon, 7 Feb 2022 16:34:21 +0000 (17:34 +0100)] 
oom: Cleanup of information dump code after kill

This is a follow up to 29f4185a9cdc ("oomd: Dump top offenders after a
kill action") to clean up the code a bit for review comments that
happened after the code had been merged already.

3 years agowatchdog: work around Coverity confusion
Lennart Poettering [Mon, 7 Feb 2022 09:59:05 +0000 (10:59 +0100)] 
watchdog: work around Coverity confusion

Coverity (and I, initially) get really confused about "fn"'s validity
here. it doesn't grok that free_and_strdup() is actually a NOP in case
the string isn't changed, and assumes it always invalidates the
specified buffer, which it doesn't do though.

Follow-up for: f4b1a6b6419b771d26342a9b75b1d77ee9d90133

3 years agojournal: Improve handling of corruption during upwards entry iteration 22442/head
Daan De Meyer [Mon, 7 Feb 2022 20:19:29 +0000 (20:19 +0000)] 
journal: Improve handling of corruption during upwards entry iteration

If we're going upwards in the journal file during entry iteration and we
can't reach the current entry due to corruption, start iterating upwards
from the last reachable entry array. This is equivalent to skipping
all entries in the array that can't be reached anymore.

Fixes #22431

3 years agojournal: Fix upwards iteration of entry items in case of corruption
Daan De Meyer [Mon, 7 Feb 2022 20:15:07 +0000 (20:15 +0000)] 
journal: Fix upwards iteration of entry items in case of corruption

8d801e35cb155faa08235a5af8b4d6ad60715837 didn't take into account
upwards iteration of entry items when we're working on a corrupted
journal file. Instead of moving to the previous entry array, we'd
always move to the next array, regardless of the iteration direction.

To fix this, we introduce bump_entry_array() that moves to the next
or previous entry array depending on the given direction. Since the
entry array chains are singly linked lists, we have to start iterating
from the front to find the previous array. We only reach this logic
if we're working on a corrupted journal file so being slow here shouldn't
matter too much.

3 years agoMerge pull request #22383 from yuwata/network-generator-keep-configuration
Luca Boccassi [Mon, 7 Feb 2022 18:06:24 +0000 (18:06 +0000)] 
Merge pull request #22383 from yuwata/network-generator-keep-configuration

network: enable KeepConfiguration= when running on network filesystem

3 years agologin: typo fix
Michael Biebl [Mon, 7 Feb 2022 16:49:26 +0000 (17:49 +0100)] 
login: typo fix

3 years agoman: fix typo
Michael Biebl [Mon, 7 Feb 2022 13:57:00 +0000 (14:57 +0100)] 
man: fix typo