93958 Commits
Author SHA1 Message Date
Christian Brauner 04b9e53f24 login: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:07 +01:00
Christian Brauner d229e8b083 libsystemd-network: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:06 +01:00
Christian Brauner 8351be43fe libsystemd: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:04 +01:00
Christian Brauner 7b11ddeb6d hostname: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:03 +01:00
Christian Brauner 08a1dd7701 home: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:02 +01:00
Christian Brauner 5ce21657cd core: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:20:00 +01:00
Christian Brauner de5ee2f9bb boot: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:19:59 +01:00
Christian Brauner 7e539a1e38 basic: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:19:58 +01:00
Christian Brauner 1d5ffd4689 analyze: comment bare literal arguments
docs/CODING_STYLE.md asks for a /* name= */ comment whenever NULL or
another value meaning "unset" is passed to a function. Add it wherever
a bare NULL, 0, false or true is passed for a parameter with a telling
name. Mechanical, generated by tools/check-argument-comments.py --fix.
2026-11-04 23:19:57 +01:00
Christian Brauner 46095348ab include: name the fsmount() parameters like the man page
The fsmount() shim took its parameter names from glibc which calls the
last one ms_flags. That's misleading as it takes MOUNT_ATTR_* flags and
not MS_* flags. The kernel and fsmount(2) call it attr_flags. Use the
names from fsmount(2) and fix up the two comments in namespace.c that
called it mount_attrs and flags.
2026-11-04 23:19:55 +01:00
Christian Brauner 5e4fa24313 mkosi: install python3-clang in the tools image
tools/check-argument-comments.py needs the libclang python bindings.
2026-11-04 23:19:54 +01:00
Christian Brauner a24b65bc71 meson: add an argument-comments test suite
Run tools/check-argument-comments.py over the sources that are compiled,
one test per top-level source directory, in a suite that a plain "meson
test" leaves out like the other linters. The NSS, PAM and cryptsetup
token modules don't end up in sources, so collect theirs as well. The
source directory is passed explicitly, so the suite works without git,
from a tarball say. The script exits with meson's skip code where the
libclang python bindings are missing.
2026-11-04 23:19:53 +01:00
Christian Brauner dee2b81067 tools: add a checker for missing argument name comments
CODING_STYLE asks for a /* name= */ comment whenever NULL or another
value meaning "unset" is passed to a function. Nothing enforces it.
clang-tidy's bugprone-argument-comment only validates comments that
exist, and its option to demand them for literals never sees NULL
behind its cast in C and flags every size and mode along the way.

Add tools/check-argument-comments.py. It parses each file with
libclang and the flags from compile_commands.json, with every set of
them for a file that is built more than once, takes the parameter
names from the first declaration the caller sees, the one clang-tidy
compares comments against, and reports arguments spelled as a bare
NULL, 0, false or true, in the file and in the in-tree headers it
includes.

The arguments are read from the text of the call. So a literal with a
comment after it is still bare, and a comment at the end of the
previous line belongs to the previous argument. Like clang-tidy, only
a /* name= */ comment names a parameter, and case and leading or
trailing underscores don't matter. A /* name */ that lost its '=' is
reported too.

Calls into libc are skipped, and so are calls produced by macro bodies
since the caller never spelled their arguments. A call written inside
a macro argument is checked, as is a call through a macro that only
renames the function, the shims in src/include/override for example,
and a call through the sym_* pointers of the dlopen() wrappers.
--diff REV limits the report to lines that differ from a revision, and
--fix inserts the comments.

    tools/check-argument-comments.py --diff "$(git merge-base main HEAD)" src

The builtin headers, stddef.h and friends, are located by asking the
clang binary of the same major version. libclang derives their
location from its own, and in the Fedora rawhide tools tree that
comes out as the relative ../lib/clang/22, so every file fails to
parse with 'stddef.h' file not found.

Needs python3-clang and libclang 19 or newer. Older versions return
the file location from clang_getSpellingLocation(), so calls produced
by macro bodies would be checked as if the caller had spelled them.
2026-11-04 23:19:52 +01:00
Luca Boccassi 4343b7c7d5 nsresourced: add an inode-based BPF policy (#44390)
Let's use idmap-aware inode LSM hooks on Linux 7.4 and newer to check
the
ownership recorded on the actual backing filesystem. This permits safe
OverlayFS uppers while rejecting persistent transient IDs, including
when a
mount idmap translates stable caller IDs into transient IDs. Older
kernels
continue to use the path policy.

Let's preserve the policy maps and replace pinned program links
atomically
on restart, so failed replacement keeps existing namespaces protected.
Tests
cover OverlayFS, mount idmaps, links, ownership changes, POSIX queue
creation
and namespace lifetimes, and failed pin replacement.
2026-11-04 19:14:11 +00:00
Yu Watanabe 3f0c5c5687 test-tpm2: convert remaining assert_se() to ASSERT_* macros
Replace the assert_se() in policy_or_tree_reference() with the typed
ASSERT_* macros, so that a failing assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 1041a88717 test-fs-util: drop assert_se() duplicating the ASSERT_OK() checks
The two xopenat_full() reopen checks were already expressed with
ASSERT_OK() right below; remove the leftover assert_se() duplicates.

Follow-up for 3295505085
2026-11-05 03:21:37 +09:00
Yu Watanabe 1bea7ef777 fuzz-xdg-desktop: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe c36fdc94a2 fuzz-link-parser: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 5fcce5b5fa fuzz-udev-rules: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 30b6cb6da5 fuzz-udev-rule-parse-value: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 650b77282b fuzz-systemctl-parse-argv: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe d25bcf2113 fuzz-resource-record: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe cec076f77b fuzz-etc-hosts: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 6b4198d7d1 fuzz-dns-packet: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe e8fd109387 fuzz-nspawn-settings: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 607729ad6a fuzz-nspawn-oci: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 1a0058fb91 fuzz-network-parser: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe f241539464 fuzz-netdev-parser: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe ac548ece67 fuzz-journal-file: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 4ec8fffed9 fuzz-bus-message: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe f86fd03386 fuzz-bus-match: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 01cc22e103 fuzz-ndisc-rs: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 9c9c6ce545 fuzz-lldp-rx: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe b446fab4bc fuzz-dhcp6-client: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 4a447d957b fuzz-journald-native-fd: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 7bfd89d912 fuzz-journal-remote: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 67ccdbbd6c fuzz-varlink: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 5b3b5efd79 fuzz-varlink-idl: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe a04e2d447a fuzz-user-record: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 36953c90d3 fuzz-udev-database: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe e88a482908 fuzz-time-util: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 8fdc22d005 fuzz-json: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 2eef4c8944 fuzz-hostname-setup: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 0fcefb1449 fuzz-env-file: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 19916b2955 fuzz-catalog: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe e9005a6ae4 fuzz-calendarspec: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 517ae3bb35 fuzz-bus-label: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 9db02cd58c fuzz-bootspec: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe c07d32f45f fuzz-unit-file: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00
Yu Watanabe 70ae87170b fuzz-manager-serialize: use ASSERT_OK() and friends
Replace assert_se() with the typed ASSERT_* macros, so that a failing
assertion logs the values involved.
2026-11-05 03:21:37 +09:00