On Tue, 17 Mar 2026 at 05:38, Sun Haoyu <[email protected]> wrote: > > openat2() ignored the -L prefix and opened host files directly. > For example, openat2("/tmp/file") opened /tmp/file on the host, not > QEMU_LD_PREFIX/tmp/file like openat() does. > > Fix this by using path() to rewrite absolute paths. Skip this > when RESOLVE_BENEATH or RESOLVE_IN_ROOT is set: > - RESOLVE_BENEATH rejects absolute paths anyway > - RESOLVE_IN_ROOT resolves relative to dirfd > > Now openat() and openat2() work in the same way. > > Link: https://gitlab.com/qemu-project/qemu/-/work_items/3341 > > Signed-off-by: Sun Haoyu <[email protected]> > --- > linux-user/syscall.c | 11 ++++++++++- > linux-user/syscall_defs.h | 7 ++++++- > 2 files changed, 16 insertions(+), 2 deletions(-)
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
