NetworkManager/src/nm-initrd-generator
Jan Vaclav 33871478b7 initrd: fix use-after-free when multiple iBFT entries fail
The error variable is declared outside the loop but freed with
g_error_free() which does not reset the pointer to NULL. On the
next iteration, g_set_error() sees a non-NULL *err (dangling pointer)
and error->message dereferences freed memory.

Use g_clear_error() instead which also resets the pointer.

Found by Coverity (CID: USE_AFTER_FREE).

Fixes: ecc074b2f8 ('initrd: add command line parser')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
..
tests initrd: support setting the DHCP client-id 2025-09-11 17:33:46 +02:00
meson.build systemd: install initrd services using a generator 2025-11-20 13:26:15 +00:00
nm-initrd-generator.c libnm-glib-aux: add temp name argument to nm_utils_file_set_contents() 2025-10-22 09:56:39 +02:00
nm-initrd-generator.h initrd: add new NBFT parser 2025-04-28 16:09:54 +00:00
nm-initrd-generator.sh systemd: install initrd services using a generator 2025-11-20 13:26:15 +00:00
nmi-cmdline-reader.c initrd: fix use-after-free when multiple iBFT entries fail 2026-04-14 12:54:12 +02:00
nmi-dt-reader.c glib-aux: avoid using inet_aton() 2023-05-08 15:44:49 +02:00
nmi-ibft-reader.c glib-aux: add and use nm_uuid_generate_from_strings_old() 2022-10-11 09:03:17 +02:00
nmi-nbft-reader.c nm-initrd-generator: fix a conn_name leak 2025-08-26 07:45:53 +00:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00

nm-initrd-generator

A command line tool that generates NetworkManager configuration.

This is supposed to be run by dracut in initrd, before NetworkManager starts. It parses the kernel command line, generates configuration and quits.

See:

  • man 8 nm-initrd-generator ([www])
  • man 7 dracut.cmdline