qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()


From: Richard Henderson
Subject: Re: [PATCH v3 2/8] linux-user: Add "safe" parameter to do_guest_openat()
Date: Tue, 6 Jun 2023 11:24:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 6/6/23 06:27, Ilya Leoshkevich wrote:
@@ -8518,7 +8522,11 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd, 
const char *pathname,
          return fd;
      }
- return safe_openat(dirfd, path(pathname), flags, mode);
+    if (safe) {
+        return safe_openat(dirfd, path(pathname), flags, mode);
+    } else {
+        return openat(dirfd, path(pathname), flags, mode);
+    }
  }

I'm not keen on this, as it seems like the wrong abstraction. But I can't immediately think of how it could be better structured.

The only concrete objection I have is the change of API, which could be fixed with return get_errno(openat(...)).

With that,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]