Repository navigation
Description
Part of #14.
inotify is complete: LTP inotify* 14 pass. fanotify has the notification and content classes: 10 pass, fanotify05 fails on a busy host by its time limit, and 14 tests do not apply (FAN_REPORT_FID, FAN_REPORT_DIR_FID, FAN_REPORT_PIDFD, FAN_REPORT_TID, FAN_PRE_ACCESS and /proc/sys/vm/vfs_cache_pressure). The keyring has the user, logon and keyring types (core/rk-proc/src/keys): keyctl* 21 pass, request_key* 6 pass, keyctl05 fails because it runs modprobe, and 8 keyctl tests do not apply because of missing key types. There is no upcall to /sbin/request-key. There are no uevents: the uevent files of /sys can only be read, and there is no NETLINK_KOBJECT_UEVENT socket.
Scope
- uevents: the protocol
NETLINK_KOBJECT_UEVENT. The kernel sendsadd,remove,change,move,bindandunbindwithACTION,DEVPATH,SUBSYSTEM,SEQNUM,MAJOR,MINORandDEVNAMEwhen a block, char or network device comes or goes. Add/sys/kernel/uevent_seqnum. A network device event goes only to the sockets of its network namespace. Test: LTP runtest/uevent (uevent01, uevent02 and uevent03). Exit: the three pass. vfs, net: device events on NETLINK_KOBJECT_UEVENT sockets #562, input: uinput and the input devices with their uevents #571: uevent01, uevent02 and uevent03 pass on x86_64. - Synthetic uevents: a write of
add,changeorremoveto aueventfile sends the event, with the optional UUID and variables, asudevadm triggerneeds. Test: a newudevdboot test on the image of thesystemdboot test, which runsudevadm trigger --action=addandudevadm settle. Exit: settle ends, and/dev/disk/by-pathhas the links ofvda. The by-path links also need the PCI tree of R5 the remaining /sys and /proc files that the images read #543. sysfs: the disks and interfaces of virtio below their virtio device, and the udevd boot test (#539) #646: theudevdboot test passes on x86_64, settle ends and /dev/disk/by-path haspci-0000:00:02.0andvirtio-pci-0000:00:02.0to vda. On arm64 the link isplatform-a003e00.virtio_mmio, as on Linux. - fanotify with file handles:
FAN_REPORT_FID,FAN_REPORT_DIR_FID,FAN_REPORT_NAMEandFAN_REPORT_TARGET_FID, with the file handles of ext4, xfs and tmpfs thatname_to_handle_atgives now. Test: LTP fanotify13 to fanotify19. Exit: these reach the pass set of the reference. fanotify: report file handles with FAN_REPORT_FID, DIR_FID, NAME and TARGET_FID #626, overlayfs: send the events of an open file to the real file, and drop the link count of a removed lower file #628, fanotify: the limits of the groups and marks of a user, and /proc/sys/fs/fanotify #635, xfs: file handles for name_to_handle_at, open_by_handle_at and fanotify #638: fanotify13 to fanotify19 pass on x86_64, and XFS gives file handles. - fanotify with pidfds and mount events:
FAN_REPORT_PIDFD,FAN_REPORT_TIDandFAN_REPORT_MNT.FAN_REPORT_PIDFDneeds pidfs from R5 systemd as PID 1: cgroup v2 controllers, namespaces and pidfds #536. Test: LTP fanotify20 and fanotify21. Exit: both pass. fanotify: FAN_REPORT_PIDFD, and the pid of an event in the PID namespace of the reader #643, fanotify: FAN_REPORT_MNT and the mount events of a mount namespace #706: fanotify21 passes on x86_64 and arm64. fanotify20 gives TCONF ("supported since v7.2") on both, the same as Linux 7.3.FAN_REPORT_MNThas the mount events of a mount namespace mark, checked by theinitboot test. - fanotify, the rest:
FAN_PRE_ACCESSon ext2 and ext4,/proc/sys/vm/vfs_cache_pressure, and the time of fanotify05 on a busy host. Test: LTP fanotify05, fanotify10, fanotify23 and fanotify24. Exit: these pass at a load average under 10. - Keys: the upcall to
/sbin/request-keywith the authorization key,KEYCTL_INSTANTIATE,KEYCTL_REJECT,KEYCTL_ASSUME_AUTHORITYandKEYCTL_GET_SECURITY, and thedns_resolverandbig_keytypes. Find why keyctl05 runsmodprobeon rukernel and not on the reference, and fix the cause. Test: LTP keyctl05 and request_key01 to request_key06, and thekeyctlpart of thesystemdboot test. Exit: these pass. - Keys: the
asymmetrictype with the X.509 and PKCS#8 parsers and RSA,KEYCTL_PKEY_*,KEYCTL_DH_COMPUTE, and theencryptedtype withuser-decrypteddata. Test: LTP keyctl09, keyctl23 and keyctl25 to keyctl30. Exit: they reach the pass set of the reference. - Make a new LTP syscalls run on both architectures and generate the tables again with tools/ltp/update.sh. Exit: the inotify, fanotify, keyctl, add_key, request_key and uevent rows reach the pass set of the reference, apart from the listed exceptions.
Done when
The LTP tests of uevents, the keyring, fanotify and inotify reach the pass set of the reference. This is the exit of the fourth item of #14.
Test each task on x86_64 and on arm64. Give the result of both in the PR body.
Linux reference: lib/kobject_uevent.c, drivers/base/core.c, fs/notify/fanotify/fanotify_user.c, fs/notify/fanotify/fanotify.c, security/keys/request_key.c, crypto/asymmetric_keys/x509_cert_parser.c, security/keys/dh.c.
Activity
tamnd commentedon Nov 3, 2026
#562 is merged. It adds the device events on
NETLINK_KOBJECT_UEVENTsockets:add,removeandchangeof character, block and loop devices go to all namespaces, andadd,removeandmoveof network devices and their queues go only to the namespace of the device./sys/kernel/uevent_seqnumgives the last number. LTP uevent01 and uevent02 pass on x86_64. uevent03 gives TCONF, because it needs uinput and the input devices. Thus the first item stays open. The uevent checks of the init boot test pass on x86_64 and arm64.tamnd commentedon Nov 3, 2026
#563 is merged. It adds the synthetic device events. A write of
ACTION [UUID [KEY=VALUE ...]]to the fileueventof a device in/syssends the event of that device, withSYNTH_UUID(0without a UUID) and aSYNTH_ARG_KEYvariable for each pair, askobject_synth_ueventof Linux. An unknown action or a bad argument givesEINVAL. A device that does not exist givesENODEV. The event of a network device goes only to its namespace.Tests (server2, load 21 to 25): the unit tests of rk-vfs, rk-net and rk-fs-sys pass.
RK_CMDLINE="-- only uevent" cargo xtask boot-test initpasses on x86_64 (also with the bzImage and UEFI) and on arm64. The gate is ok.The item stays open. Its exit needs the
udevdboot test withudevadm triggerandudevadm settleon the image of thesystemdboot test, and the/dev/disk/by-pathlinks need the PCI tree of #543. Only the devices under/sys/devices/virtualhave a writableueventfile now.tamnd commentedon Nov 4, 2026
#571 is merged. It adds the input devices and
/dev/uinput.UI_DEV_CREATEmakesinputNwith itseventNhandler (andmouseNfor a mouse) and sends theiraddevents with the variables of Linux (PRODUCT,NAME,PROP,EV,KEY,REL,MODALIAS, andMAJOR,MINORandDEVNAMEfor the handlers).UI_DEV_DESTROYsends theremoveevents. It also adds/sys/devices/virtual/input,/sys/class/inputand/proc/bus/input/devices. The handlers do not give input events yet.Tests on server2 at load 15 to 56: LTP uevent01, uevent02 and uevent03 pass on x86_64 (uevent03 gave TCONF before). The
only ueventboot test passes on x86_64 (bzImage and UEFI) and arm64. The gate of #571 is ok.With #562 and #571, the exit of the uevent item is met, so I ticked it.
tamnd commentedon Nov 4, 2026
#573 is merged. It adds the
dns_resolverkey type (binary server list and text form, no update, a list with no good lookup expires after one second). A new key of a type with no update now gets no write permission, as Linux.The cause of the
modprobefailure of keyctl05: themodprobeof BusyBox gives 0 only for a module in/proc/modulesormodules.builtin. The LTP init script listed onlyvethanddummyinmodules.builtin, and rukernel had nodns_resolvertype. tools/ltp/run.py now listsdns_resolver.Tests on server2 at load 15 to 29: keyctl05 passes on x86_64 (TBROK before), and request_key01 to request_key06 pass. The new init checks pass on x86_64 (bzImage and UEFI) and arm64. There is no arm64 LTP build on the servers. The gate of #573 is ok.
The keys item stays open. Not done yet: the upcall to
/sbin/request-keywith the authorization key (the kernel has no way to start a user program yet),KEYCTL_INSTANTIATE,KEYCTL_REJECTandKEYCTL_ASSUME_AUTHORITY(they need the authorization key), thebig_keytype, thednserrorerror of adns_resolverkey, and thekeyctlpart of thesystemdboot test.tamnd commentedon Nov 4, 2026
#575 adds socket filters (
SO_ATTACH_FILTER,SO_DETACH_FILTER,SO_LOCK_FILTER) to netlink sockets, assk_filterinnetlink_unicastandnetlink_broadcastof Linux. The udev monitor of systemd (sd-device and libudev) needs this for itsNETLINK_KOBJECT_UEVENTsocket. The kernel's own replies do not go through the filter, as in Linux.Tests on server2:
cargo test -p rk-net netlink17 pass. The newonly ueventinit check passes on x86_64 (bzImage and UEFI) and arm64: a datagram with the libudev header gets through the filter, a plain kernel-style event is dropped, and afterSO_LOCK_FILTERa detach givesEPERM. The systemd boot test stops earlier, at the generators, with or without this change (see #536), so it does not show the udev monitor yet.Still open in this issue: the synthetic uevent item needs the udevd boot test and the PCI tree of #543. The keys item needs the
/sbin/request-keyupcall,KEYCTL_INSTANTIATE,KEYCTL_REJECT,KEYCTL_ASSUME_AUTHORITY,big_key, thednserroroption ofdns_resolver, and thekeyctlpart of the systemd boot test.tamnd commentedon Nov 4, 2026
Keys, step 1, is in #579. It adds key construction with the
.request_key_authkey, plusKEYCTL_ASSUME_AUTHORITY,KEYCTL_INSTANTIATE,KEYCTL_INSTANTIATE_IOV,KEYCTL_NEGATEandKEYCTL_REJECT. The upcall that runs/sbin/request-keycomes next.tamnd commentedon Nov 4, 2026
Keys, step 2, is in #586. It adds the user mode helper (kernel/umh.c), and with it
request_keynow runs/sbin/request-keyfor a construction. Next comesbig_keyand storing thednserroroption.tamnd commentedon Nov 4, 2026
Keys, step 3, is in #587: the
big_keytype, anddns_resolverkeys that keep the error of thednserroroption. That ends the three keys steps (#579, #586 and this PR).tamnd commentedon Nov 5, 2026
#611 adds
SO_PASSCREDandSCM_CREDENTIALSto netlink sockets. The device monitor of systemd setsSO_PASSCREDon itsNETLINK_KOBJECT_UEVENTsocket and stops on an error. Before, the call gaveENOPROTOOPT, so systemd-logind stopped at the start, about 50 times in eachsystemdboot test. A uevent of the kernel now comes with PID, UID and GID 0, as on Linux.Results:
cargo test -p rk-net netlink19 passed. Theueventinit checks pass on x86_64 (load average 14.63, 19.88, 25.37) and arm64 (load average 21.31, 20.82, 23.68), with a new check ofSO_PASSCRED. In thesystemdboot test on server1 (load average about 1), logind starts and nosystemd-logind.servicefailure is logged.No box changes. This fix is not one of the items of this issue.
fanotify: report file handles with FAN_REPORT_FID, DIR_FID, NAME and …
tamnd commentedon Nov 6, 2026
fanotify with file handles: #626 merged.
FAN_REPORT_FID,FAN_REPORT_DIR_FID,FAN_REPORT_NAMEandFAN_REPORT_TARGET_FIDwork, with the handles ofname_to_handle_at, the dirent events,FAN_RENAMEand the self events.What remains for this item:
/proc/sys/fs/fanotify/max_user_groupsandmax_user_marks,EMFILEandENOSPC).file_handle, so a mount or file system mark of a FID group on xfs givesEOPNOTSUPP.overlayfs: send the events of an open file to the real file, and drop…
tamnd commentedon Nov 6, 2026
fanotify13 overlayfs variants: #628 merged.
What remains for item 1: fanotify17 (the limits of the groups and marks of a user), and xfs has no
file_handle.fanotify: the limits of the groups and marks of a user, and /proc/sys…
tamnd commentedon Nov 7, 2026
fanotify group and mark limits: #635 merged.
fanotify_initgivesEMFILE. A mark counts for the same user, and over the limit it givesENOSPC./proc/sys/fs/fanotify/max_user_groups,max_user_marksandmax_queued_eventsare new.What remains for item 1: xfs has no
file_handle, so a mount or file system mark of a FID group on xfs givesEOPNOTSUPP. The image has no mkfs.xfs, so LTP did not test xfs. Item 2 (FAN_REPORT_PIDFD,FAN_REPORT_TID,FAN_REPORT_MNT, fanotify20 and fanotify21) is not started.xfs: file handles for name_to_handle_at, open_by_handle_at and fanoti…
tamnd commentedon Nov 7, 2026
XFS file handles: #638 merged.
name_to_handle_aton XFS gives the handleFILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAGwith the inode number and the generation, andopen_by_handle_atfinds the inode again, as fs/xfs/xfs_export.c of Linux.cargo test -p rk-fs-xfspasses. LTP did not test XFS, because the image has no mkfs.xfs.Item 1 is now complete: ext4, XFS and tmpfs give file handles, and LTP fanotify13 to fanotify19 pass on x86_64. What remains: item 2 (
FAN_REPORT_PIDFD,FAN_REPORT_TIDwith a pidfd,FAN_REPORT_MNT, fanotify20 and fanotify21).fanotify: FAN_REPORT_PIDFD, and the pid of an event in the PID namesp…
tamnd commentedon Nov 7, 2026
fanotify
FAN_REPORT_PIDFD: #643 merged.FAN_REPORT_TIDthe pidfd refers to the thread.FAN_NOPIDFD,FAN_EPIDFDand theFAN_REPORT_FD_ERRORerrors are as in Linux.FAN_REPORT_PIDFD | FAN_REPORT_TIDis now allowed.What remains for item 2:
FAN_REPORT_MNT(the mount eventsFAN_MNT_ATTACHandFAN_MNT_DETACHand the marks on a mount namespace). fanotify20 cannot pass on a kernel of 7.2 or later, so its exit is TCONF.sysfs: the disks and interfaces of virtio below their virtio device, …
tamnd commentedon Nov 7, 2026
Synthetic uevents: #646 merged.
/sys/devices/pci0000:00/0000:00:02.0/virtio1/block/vda. A write ofadd,changeorremoveto theirueventfiles sends the event with the optional UUID and variables.udevdboot test boots the tree of thesystemdtest, runsudevadm trigger --action=addandudevadm settle, and checks /dev/disk/by-path. On x86_64 (server1, load 1.0) it passes: settle ends, ID_PATH ispci-0000:00:02.0, and /dev/disk/by-path haspci-0000:00:02.0andvirtio-pci-0000:00:02.0to vda. Thesystemdtest also passes with the new tree.udevadm settleends and /dev/disk/by-path hasplatform-a003e00.virtio_mmioto vda. Linux 6.8 on x86_64 and the Linux arm64 build give the same links with the same tree.udevdtest runs only on x86_64 in xtask. systemd-resolved is not in the tree yet, because it stops withENOPROTOOPTon rukernel. That is for thenetworkdtest of R5 netlink: rules, nexthops, generic netlink and ethtool for networkd, resolved and udevd #538.tamnd commentedon Nov 12, 2026
#706 is merged. It adds
FAN_REPORT_MNT, so the item "fanotify with pidfds and mount events" is done (FAN_REPORT_PIDFDandFAN_REPORT_TIDcame in #643).FAN_REPORT_MNTmarks a mount namespace withFAN_MARK_MNTNS. It getsFAN_MNT_ATTACHandFAN_MNT_DETACHon mount, move, unmount andpivot_root, with aFAN_EVENT_INFO_TYPE_MNTrecord of 16 bytes that has the unique mount ID. The errors and the record layout are the same as in Linux 7.3.FAN_REPORT_MNT. Theinitboot test (only fanotify) has 17 checks for it: pass on x86_64 and arm64, load average 18.9 to 22.3.The full gate did not run.