From 3177c82a6a33a53d60cc70fb3c5c6758c442314d Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:01 +0100 Subject: [PATCH] Revert "tomoyo: fallback to realpath if symlink's pathname does not exist" This reverts commit 8d86e29a5484378fd7d31cebac8658f4d67cfe9d. --- security/tomoyo/domain.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 2e00a2d6f..dc4ecc0b2 100755 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c @@ -725,13 +725,10 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm) ee->r.obj = &ee->obj; ee->obj.path1 = bprm->file->f_path; /* Get symlink's pathname of program. */ + retval = -ENOENT; exename.name = tomoyo_realpath_nofollow(original_name); - if (!exename.name) { - /* Fallback to realpath if symlink's pathname does not exist. */ - exename.name = tomoyo_realpath_from_path(&bprm->file->f_path); - if (!exename.name) - goto out; - } + if (!exename.name) + goto out; tomoyo_fill_path_info(&exename); retry: /* Check 'aggregator' directive. */