From 0a1f8585144055ba82adfc0f5c35156303521231 Mon Sep 17 00:00:00 2001 From: yushiqie Date: Thu, 15 Aug 2024 14:41:06 +0800 Subject: [PATCH] fix path referrer not a strict subpath of "/proc" --- src/path/path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/path/path.c b/src/path/path.c index bc6c49a8..83a502db 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -419,13 +419,14 @@ int detranslate_path(Tracee *tracee, char path[PATH_MAX], const char t_referrer[ /* Is it a symlink? */ if (t_referrer != NULL) { Comparison comparison; + Comparison path_comparison; sanity_check = false; follow_binding = false; - /* In some cases bindings have to be resolved. */ comparison = compare_paths("/proc", t_referrer); - if (comparison == PATH1_IS_PREFIX) { + path_comparison = compare_paths("/proc", path); + if (comparison == PATH1_IS_PREFIX && path_comparison != PATHS_ARE_NOT_COMPARABLE) { /* Some links in "/proc" are generated * dynamically by the kernel. PRoot has to * emulate some of them. */