This caused a failure with program using openat2, where O_LARGEFILE was
replaced by O_NOFOLLOW.
This issue is only visible when QEMU is compiled with musl libc, where
O_LARGEFILE is different from 0 (vs glibc).
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
linux-user/aarch64/target_fcntl.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h
index efdf6e5f058..55ab788a7ce 100644
--- a/linux-user/aarch64/target_fcntl.h
+++ b/linux-user/aarch64/target_fcntl.h
@@ -11,6 +11,7 @@
#define TARGET_O_DIRECTORY 040000 /* must be a directory */
#define TARGET_O_NOFOLLOW 0100000 /* don't follow links */
#define TARGET_O_DIRECT 0200000 /* direct disk access hint */
+#define TARGET_O_LARGEFILE 0400000
#include "../generic/fcntl.h"
#endif
--
2.47.3
On 1/13/26 11:40 AM, Pierrick Bouvier wrote: > This caused a failure with program using openat2, where O_LARGEFILE was > replaced by O_NOFOLLOW. > This issue is only visible when QEMU is compiled with musl libc, where > O_LARGEFILE is different from 0 (vs glibc). > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > linux-user/aarch64/target_fcntl.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h > index efdf6e5f058..55ab788a7ce 100644 > --- a/linux-user/aarch64/target_fcntl.h > +++ b/linux-user/aarch64/target_fcntl.h > @@ -11,6 +11,7 @@ > #define TARGET_O_DIRECTORY 040000 /* must be a directory */ > #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ > #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ > +#define TARGET_O_LARGEFILE 0400000 > > #include "../generic/fcntl.h" > #endif Michael, any chance you could pull this as part of one of your series for linux-user? Regards, Pierrick
On 1/13/26 22:40, Pierrick Bouvier wrote: > This caused a failure with program using openat2, where O_LARGEFILE was > replaced by O_NOFOLLOW. > This issue is only visible when QEMU is compiled with musl libc, where > O_LARGEFILE is different from 0 (vs glibc). > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > linux-user/aarch64/target_fcntl.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h > index efdf6e5f058..55ab788a7ce 100644 > --- a/linux-user/aarch64/target_fcntl.h > +++ b/linux-user/aarch64/target_fcntl.h > @@ -11,6 +11,7 @@ > #define TARGET_O_DIRECTORY 040000 /* must be a directory */ > #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ > #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ > +#define TARGET_O_LARGEFILE 0400000 > > #include "../generic/fcntl.h" > #endif Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Heck. I was this >< close to discovering this :)) Thanks, /mjt
On 1/13/26 1:53 PM, Michael Tokarev wrote: > On 1/13/26 22:40, Pierrick Bouvier wrote: >> This caused a failure with program using openat2, where O_LARGEFILE was >> replaced by O_NOFOLLOW. >> This issue is only visible when QEMU is compiled with musl libc, where >> O_LARGEFILE is different from 0 (vs glibc). >> >> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 >> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> >> --- >> linux-user/aarch64/target_fcntl.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h >> index efdf6e5f058..55ab788a7ce 100644 >> --- a/linux-user/aarch64/target_fcntl.h >> +++ b/linux-user/aarch64/target_fcntl.h >> @@ -11,6 +11,7 @@ >> #define TARGET_O_DIRECTORY 040000 /* must be a directory */ >> #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ >> #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ >> +#define TARGET_O_LARGEFILE 0400000 >> >> #include "../generic/fcntl.h" >> #endif > > Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> > > Heck. I was this >< close to discovering this :)) > > Thanks, > > /mjt Given that we both took a look at this, and the original bug reporter also, I think it can be considered as a shared "discovery" :).
On 13/1/26 20:40, Pierrick Bouvier wrote: > This caused a failure with program using openat2, where O_LARGEFILE was > replaced by O_NOFOLLOW. > This issue is only visible when QEMU is compiled with musl libc, where > O_LARGEFILE is different from 0 (vs glibc). > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > linux-user/aarch64/target_fcntl.h | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On 1/13/26 11:40 AM, Pierrick Bouvier wrote: > This caused a failure with program using openat2, where O_LARGEFILE was > replaced by O_NOFOLLOW. > This issue is only visible when QEMU is compiled with musl libc, where > O_LARGEFILE is different from 0 (vs glibc). > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > linux-user/aarch64/target_fcntl.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h > index efdf6e5f058..55ab788a7ce 100644 > --- a/linux-user/aarch64/target_fcntl.h > +++ b/linux-user/aarch64/target_fcntl.h > @@ -11,6 +11,7 @@ > #define TARGET_O_DIRECTORY 040000 /* must be a directory */ > #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ > #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ > +#define TARGET_O_LARGEFILE 0400000 > > #include "../generic/fcntl.h" > #endif As well, I double checked all the flags for all arch compared to upstream Linux headers, and it was the only mismatch.
On 1/13/26 11:40 AM, Pierrick Bouvier wrote: > This caused a failure with program using openat2, where O_LARGEFILE was > replaced by O_NOFOLLOW. > This issue is only visible when QEMU is compiled with musl libc, where > O_LARGEFILE is different from 0 (vs glibc). > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 > Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> > --- > linux-user/aarch64/target_fcntl.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h > index efdf6e5f058..55ab788a7ce 100644 > --- a/linux-user/aarch64/target_fcntl.h > +++ b/linux-user/aarch64/target_fcntl.h > @@ -11,6 +11,7 @@ > #define TARGET_O_DIRECTORY 040000 /* must be a directory */ > #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ > #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ > +#define TARGET_O_LARGEFILE 0400000 > > #include "../generic/fcntl.h" > #endif This is a good candidate for all stable branches as well. Regards, Pierrick
© 2016 - 2026 Red Hat, Inc.