This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] uprobes-inode: add support for overlayfs
- From: Christopher Dion <Christopher dot Dion at dell dot com>
- To: systemtap at sourceware dot org
- Cc: Christopher Dion <Christopher dot Dion at dell dot com>
- Date: Mon, 14 May 2018 14:08:58 -0400
- Subject: [PATCH] uprobes-inode: add support for overlayfs
Use d_real_inode() instead of i_node directly. For normal filesystems
this will just return the inode. In the case of overlayfs it will obtain
the underlying dentry and corresponding inode. This allows the probe to
find binaries in an overlayfs.
Signed-off-by: Christopher Dion <Christopher.Dion@dell.com>
---
runtime/linux/uprobes-inode.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/runtime/linux/uprobes-inode.c b/runtime/linux/uprobes-inode.c
index 6d450c9..7923545 100644
--- a/runtime/linux/uprobes-inode.c
+++ b/runtime/linux/uprobes-inode.c
@@ -705,7 +705,7 @@ stapiu_get_task_inode(struct task_struct *task)
vm_file = stap_find_exe_file(mm);
if (vm_file) {
if (vm_file->f_path.dentry)
- inode = vm_file->f_path.dentry->d_inode;
+ inode = d_real_inode(vm_file->f_path.dentry);
fput(vm_file);
}
return inode;
@@ -757,7 +757,7 @@ stapiu_mmap_found(struct stap_task_finder_target *tf_target,
* the target's inode isn't set, this is the first time we've
* seen this target.
*/
- if (target->inode && dentry->d_inode != target->inode)
+ if (target->inode && d_real_inode(dentry) != target->inode)
return 0;
/* The file path must match too. */
@@ -777,7 +777,7 @@ stapiu_mmap_found(struct stap_task_finder_target *tf_target,
/* Check non-writable, executable sections for probes. */
if ((vm_flags & VM_EXEC) && !(vm_flags & VM_WRITE))
rc = stapiu_change_plus(target, task, addr, length,
- offset, vm_flags, dentry->d_inode);
+ offset, vm_flags, d_real_inode(dentry));
/* Check writeable sections for semaphores.
* NB: They may have also been executable for the check above,
--
1.9.4