Find a file
Alvin Šipraga 9c5b8d46e5 network: fix race between RTM_NEWLINK and NL82011_CMD_NEW_INTERFACE
When a new wireless network interface is created by the kernel, it emits
both RTM_NEWLINK and NL80211_CMD_NEW_INTERFACE. These events can arrive
in either order and networkd must behave correctly in both cases.

The typical case is that RTM_NEWLINK is handled first, in which case
networkd creates a Link object and starts tracking it. When the
NL80211_CMD_NEW_INTERFACE message is handled, networkd then populates
the Link object with relevant wireless properties such as wireless
interface type (managed, AP, etc.).

In the event that the order is reversed however, networkd will fail to
populate these wireless properties because at the time of processing the
nl80211 message, the link is considered unknown. In that case, a debug
message is emitted:

  systemd-networkd[467]: nl80211: received new_interface(7) message for link '109' we don't know about, ignoring.

This is problematic because after the subsequent RTM_NEWLINK message,
networkd will have an incomplete view of the link. In particular, if a
.network configuration matches on some of the missing wireless
properties, such as WLANInterfaceType=, then it will never match.

The above race can be reproduced by using the mac80211_hwsim driver.
Suppose that there exists a .network configuration:

  [Match]
  WLANInterfaceType=ap
  ...

Now loop the creation/destruction of such an AP interface:

  while true
  do
    iw dev wlan0 interface add uap0 type __ap
    iw dev uap0 del
  done

The above debug message from networkd will then be observed very
quickly. And in that event, the .network file will fail to match.

To address the above race, have the nl80211 message handler store the
interface index in a set in case a Link object is not found on
NL80211_CMD_NEW_INTERFACE. The handler for RTM_NEWLINK can then query
this set, and explicitly request the wireless properties from nl80211
upon the creation of the Link object.
2023-01-12 13:28:36 +09:00
.clusterfuzzlite ci: unpin CFLite 2022-04-26 09:13:57 +00:00
.github github: use 'meson setup' 2023-01-11 16:46:24 +01:00
.semaphore semaphore: remove the Semaphore repositories recursively 2022-11-08 01:11:44 +09:00
catalog man: reword "string is extended into PCR" 2023-01-11 17:13:05 +01:00
coccinelle tree-wide: use -EBADF for fd initialization 2022-12-19 15:00:57 +01:00
docs bootctl: honor $KERNEL_INSTALL_CONF_ROOT 2023-01-10 15:17:07 +01:00
factory meson: also allow setting GIT_VERSION via templates 2022-04-05 22:18:31 +02:00
hwdb.d hwdb: Add mount matrix for Linx 1020 2023-01-11 22:19:57 +09:00
LICENSES network: change license of examples to MIT-0 2022-10-26 08:39:34 +02:00
man optionally set socket priority on DHCPv4 raw socket 2023-01-12 13:26:47 +09:00
mkosi.conf.d mkosi: Drop i686 packages 2022-12-13 22:00:04 +09:00
modprobe.d meson: install the right README file in modprobe.d 2021-07-07 14:52:05 +02:00
network network: change license of examples to MIT-0 2022-10-26 08:39:34 +02:00
po po: Translated using Weblate (Portuguese) 2022-12-12 13:26:55 +09:00
presets journal: give the ability to enable/disable systemd-journald-audit.socket 2023-01-11 17:18:57 +01:00
rules.d udev: also create partition /dev/disk/by-diskseq/ symlinks 2022-12-23 12:42:37 +01:00
shell-completion Implement --luks-pbkdf-force-iterations for homed 2022-12-06 15:56:11 +01:00
src network: fix race between RTM_NEWLINK and NL82011_CMD_NEW_INTERFACE 2023-01-12 13:28:36 +09:00
sysctl.d tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sysusers.d Use descriptive name for nobody 2022-05-27 22:09:24 +01:00
test test: add Type=notify-reload testcase 2023-01-10 18:28:38 +01:00
tmpfiles.d tmpfiles.d: do not fail if provision.conf fails 2022-11-04 15:42:16 +01:00
tools oss-fuzz: include generated corpora in the final zip file 2023-01-07 17:44:23 +01:00
units journal: give the ability to enable/disable systemd-journald-audit.socket 2023-01-11 17:18:57 +01:00
xorg xorg/50-systemd-user: add a full license header 2021-10-01 14:45:00 +02:00
.clang-format clang-format: Adjust style of pointers 2022-05-30 04:00:54 +09:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.editorconfig docs: configure editorconfig for css and html 2022-05-17 21:13:17 +02:00
.gitattributes gitattributes: introduce and use "generated" attribute 2021-10-18 09:42:55 +02:00
.gitignore core/cgroup: CPUWeight/CPUShares support idle input 2022-08-11 14:25:58 +02:00
.mailmap mailmap: two more names 2021-03-30 13:17:58 +02:00
.packit.yml packit: drop/replace deprecated directives 2022-12-15 21:48:49 +09:00
.vimrc scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure tools: shellcheck-ify tool scripts 2021-09-30 12:27:06 +02:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile tree-wide: add spdx header on all scripts and helpers 2021-01-28 09:55:35 +01:00
meson.build meson: use 0|1 for SD_BOOT 2023-01-10 14:25:57 +01:00
meson_options.txt boot: Remove option TPM PCR compat option 2023-01-09 09:52:55 +01:00
mkosi.build mkosi: Make sure selftests bpftool is accessible from $PATH 2022-12-05 10:51:24 +01:00
mkosi.kernel.config mkosi: Enable CONFIG_ZBOOT 2022-12-13 21:27:15 +01:00
mkosi.postinst mkosi: drop spaces after shell redirection operator 2022-11-14 11:59:30 +01:00
NEWS optionally set socket priority on DHCPv4 raw socket 2023-01-12 13:26:47 +09:00
README ci: install pefile 2022-12-07 15:53:47 +01:00
README.md README.md: add a missing line break 2022-10-19 11:17:33 +02:00
TODO update TODO 2023-01-10 18:28:38 +01:00

Systemd

System and Service Manager

Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
CentOS CI - CentOS 8
CentOS CI - Arch
CentOS CI - Arch (sanitizers)
CentOS CI - Rawhide (SELinux)
Fossies codespell report
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.