fix: support Linux 7 DKMS builds#217
Conversation
|
Hi @guanzi008. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's GuideUpdates vfs_monitor kretprobes to handle Linux 7.x VFS helper signature changes (including vfs_mkdir returning int-or-pointer) and adds a DKMS helper script plus install wiring that selects the kernel’s clang/LLD toolchain and uses mktemp for safe compiler feature probing. Sequence diagram for updated vFS vfs_mkdir kretprobe handling (int-or-pointer return)sequenceDiagram
participant Kernel
participant vfs_mkdir
participant vfs_mkdir_krp
participant common_vfs_ent
participant common_vfs_ret_int_or_ptr
participant vfs_changed_entry
participant vfs_event_free
Kernel->>vfs_mkdir: call
activate vfs_mkdir
vfs_mkdir-->>vfs_mkdir_krp: entry_handler on_vfs_mkdir_ent
activate vfs_mkdir_krp
vfs_mkdir_krp->>common_vfs_ent: common_vfs_ent(event_ptr, dentry)
common_vfs_ent-->>vfs_mkdir_krp: event stored in ri->data
deactivate vfs_mkdir_krp
vfs_mkdir-->>Kernel: return (int or dentry *)
deactivate vfs_mkdir
Kernel-->>vfs_mkdir_krp: handler on_vfs_mkdir_ret
activate vfs_mkdir_krp
vfs_mkdir_krp->>common_vfs_ret_int_or_ptr: common_vfs_ret_int_or_ptr(event_ptr, regs, ACT_NEW_FOLDER)
alt [regs_return_value is not error]
common_vfs_ret_int_or_ptr->>vfs_changed_entry: vfs_changed_entry(event)
vfs_changed_entry-->>common_vfs_ret_int_or_ptr: ok
else [regs_return_value is error]
common_vfs_ret_int_or_ptr->>vfs_event_free: vfs_event_free(event)
vfs_event_free-->>common_vfs_ret_int_or_ptr: freed
end
common_vfs_ret_int_or_ptr-->>vfs_mkdir_krp: return 0
deactivate vfs_mkdir_krp
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
bc84222 to
586b303
Compare
|
TAG Bot New tag: 7.0.42 |
Linux 7 changed the VFS helper prototypes used by vfs_monitor. The existing kretprobe mapping still reads the vfs_create dentry from the old argument position, so the module can dereference an integer mode value as a dentry and trigger a kernel Oops. Add a Linux 7 probe mapping for the new signatures and handle vfs_mkdir return values that may be either status codes or dentry pointers across supported kernels.
Some supported kernels are built with clang and LLD. Building their DKMS module with the default compiler can fail when the kernel expects the LLVM toolchain. Add a DKMS build wrapper that detects the kernel compiler from compile.h, selects a matching clang and ld.lld when needed, and uses a mktemp-based compiler probe so parallel builds do not share a fixed temporary object file.
586b303 to
8a25134
Compare
|
@Johnson-zs @wangrong1069 麻烦帮忙看下这个 OBS 失败。 #217 rebase 到 7.0.42 之后,kernelmod 这边的改动和 #219 的 analyzer/searcher 改动没有文件重叠。不过现在 后面也会继续报: OBS 里安装的是 另外 |
CI的liblucene++版本未更新,可忽略此编译失败 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: guanzi008, lzwind, wangrong1069 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
This is the develop/snipe-based replacement for #216.
The Linux 7.0 kernel changed the VFS helper prototypes used by
vfs_monitor. In particular,vfs_create()now passes the targetstruct dentry *as the second argument. The old probe code still read the third argument, which isumode_ton 7.0, and then dereferenced it as a dentry. That causeson_vfs_create_entto hit a kernel Oops shortly after the module is loaded.This patch adds a Linux 7.0+ probe mapping for the changed VFS signatures and handles
vfs_mkdir()returning either an int status or a dentry pointer, depending on the kernel version.It also keeps the DKMS build compatible with clang-built kernels by selecting the matching clang/lld toolchain from
include/generated/compile.h. The compiler feature probe now usesmktempso parallel DKMS builds do not share a fixed temporary object file.The timer-based startup delay from #216 is intentionally not included; the LightDM hang was a symptom of the kernel Oops, not a service ordering issue.
Validation
Tested on deepin 25 with
7.0.8-cachyos-x64v3:vfs_monitor.kobuilds with clang/lld selected from the kernel headersinsmodsucceedsrmmod vfs_monitorsucceeds and logsvfs_monitor: clearup okBuild checks on the same machine:
6.12.65-amd64-desktop-rolling: build ok6.18.19-amd64-desktop-rolling: build ok7.0.8-cachyos-x64v3: build oksh -n src/kernelmod/dkms-make.shgit diff --check origin/develop/snipe..HEADSummary by Sourcery
Add support for Linux 7.x VFS API changes and DKMS builds on clang-built kernels.
New Features:
Enhancements:
Build: