From 9b0bf33f790dc58d6f724ff190730895899dff3c Mon Sep 17 00:00:00 2001 From: Tiberiu Bucur <36485854+TiberiuBucur@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:07:39 +0000 Subject: [PATCH] sim: Remove trailing / from proc/meminfo special path (#689) Note: A bug was identified in that the one of the special file paths, namely /proc/meminfo contained an extra trailing /, implicitly making the incorrect assumption that meminfo was a directory, when it is, in fact, a (pseudo-)file. This was causing application in SE mode to fail opening the meminfo pseudo-file with errno 13. This commit fixes this issue. Change-Id: I93fa81cab49645d70775088f1e634f067b300698 Reviewed-by: Richard Cooper --- src/sim/syscall_emul.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index c23521aed9..97749f325d 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013, 2015, 2019-2021 Arm Limited + * Copyright (c) 2012-2013, 2015, 2019-2021, 2023 Arm Limited * Copyright (c) 2015 Advanced Micro Devices, Inc. * All rights reserved * @@ -866,7 +866,7 @@ openatFunc(SyscallDesc *desc, ThreadContext *tc, int sim_fd = -1; std::string used_path; std::vector special_paths = - { "/proc/meminfo/", "/system/", "/platform/", "/etc/passwd", + { "/proc/meminfo", "/system/", "/platform/", "/etc/passwd", "/proc/self/maps", "/dev/urandom", "/sys/devices/system/cpu/online" }; for (auto entry : special_paths) {