From 9eb5e796f3a602aa6bf27875d50bbdc282e18279 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 26 Sep 2025 15:24:58 +0800 Subject: [PATCH] fix: cwd_read bug when path is bind mounted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a bug in the cwd_read function where the path resolution was incorrect when dealing with bind mounted paths. The issue was in how the vfsmnt was being accessed - we now correctly use the parent's mnt reference to ensure proper path resolution in bind mount scenarios. Fixes the issue where cwd_read would return incorrect paths for bind mounted directories. 🤖 Generated with [Claude Code] Change-Id: I0969f8bbf96072578bcfaeec19578430365e2829 Co-developed-by: Claude --- src/security/bpf_process_event.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/security/bpf_process_event.h b/src/security/bpf_process_event.h index 06b0567..1296c94 100644 --- a/src/security/bpf_process_event.h +++ b/src/security/bpf_process_event.h @@ -207,8 +207,7 @@ FUNC_INLINE long cwd_read(struct cwd_read_data *data) bpf_probe_read(&data->dentry, sizeof(data->dentry), _(&mnt->mnt_mountpoint)); data->mnt = parent; - bpf_probe_read(&data->vfsmnt, sizeof(data->vfsmnt), - _(&mnt->mnt)); + data->vfsmnt = _(&parent->mnt); return 0; } // resolved all path components successfully -- Gitee