qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user: fix translation of statx structures
@ 2019-11-22 17:40 Ariadne Conill
  2019-11-22 18:27 ` Aleksandar Markovic
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ariadne Conill @ 2019-11-22 17:40 UTC (permalink / raw)
  To: riku.voipio, laurent; +Cc: qemu-devel, Ariadne Conill

All timestamps were copied to atime instead of to their respective
fields.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
---
 linux-user/syscall.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ce399a55f0..171c0caef3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
     __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);
     __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);
     __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec);
-    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec);
-    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec);
-    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec);
-    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec);
-    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
-    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec);
+    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec);
+    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec);
+    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec);
+    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec);
+    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec);
+    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);
     __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major);
     __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);
     __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major);
-- 
2.24.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] linux-user: fix translation of statx structures
  2019-11-22 17:40 [PATCH] linux-user: fix translation of statx structures Ariadne Conill
@ 2019-11-22 18:27 ` Aleksandar Markovic
  2019-11-22 19:41   ` Philippe Mathieu-Daudé
  2019-11-22 21:26   ` Ariadne Conill
  2019-11-22 20:30 ` Laurent Vivier
  2019-11-25  8:42 ` Laurent Vivier
  2 siblings, 2 replies; 6+ messages in thread
From: Aleksandar Markovic @ 2019-11-22 18:27 UTC (permalink / raw)
  To: Ariadne Conill; +Cc: Riku Voipio, Laurent Vivier, QEMU Developers

On Fri, Nov 22, 2019 at 7:22 PM Ariadne Conill <ariadne@dereferenced.org> wrote:
>
> All timestamps were copied to atime instead of to their respective
> fields.
>
> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> ---

What a bug.

Laurent, perhaps a good candidate for 4.2?

Thanks for submitting this, Ariadne Conill!

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>

>  linux-user/syscall.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index ce399a55f0..171c0caef3 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
>      __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);
>      __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);
>      __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> +    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec);
> +    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec);
> +    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec);
> +    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec);
> +    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec);
> +    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);
>      __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major);
>      __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);
>      __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major);
> --
> 2.24.0
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] linux-user: fix translation of statx structures
  2019-11-22 18:27 ` Aleksandar Markovic
@ 2019-11-22 19:41   ` Philippe Mathieu-Daudé
  2019-11-22 21:26   ` Ariadne Conill
  1 sibling, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-11-22 19:41 UTC (permalink / raw)
  To: Aleksandar Markovic, Ariadne Conill
  Cc: Riku Voipio, Laurent Vivier, QEMU Developers

On 11/22/19 7:27 PM, Aleksandar Markovic wrote:
> On Fri, Nov 22, 2019 at 7:22 PM Ariadne Conill <ariadne@dereferenced.org> wrote:
>>
>> All timestamps were copied to atime instead of to their respective
>> fields.
>>

Fixes: efa921845c0

>> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
>> ---
> 
> What a bug.
> 
> Laurent, perhaps a good candidate for 4.2?

Agreed.

> 
> Thanks for submitting this, Ariadne Conill!

And welcome to QEMU :)

> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>>   linux-user/syscall.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>> index ce399a55f0..171c0caef3 100644
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
>>       __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);
>>       __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);
>>       __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec);
>> -    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec);
>> -    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec);
>> -    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec);
>> -    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec);
>> -    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
>> -    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec);
>> +    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec);
>> +    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec);
>> +    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec);
>> +    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec);
>> +    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec);
>> +    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);
>>       __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major);
>>       __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);
>>       __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major);
>> --
>> 2.24.0
>>
>>
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] linux-user: fix translation of statx structures
  2019-11-22 17:40 [PATCH] linux-user: fix translation of statx structures Ariadne Conill
  2019-11-22 18:27 ` Aleksandar Markovic
@ 2019-11-22 20:30 ` Laurent Vivier
  2019-11-25  8:42 ` Laurent Vivier
  2 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2019-11-22 20:30 UTC (permalink / raw)
  To: Ariadne Conill, riku.voipio; +Cc: qemu-devel

Le 22/11/2019 à 18:40, Ariadne Conill a écrit :
> All timestamps were copied to atime instead of to their respective
> fields.
> 
> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> ---
>  linux-user/syscall.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index ce399a55f0..171c0caef3 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
>      __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);
>      __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);
>      __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> +    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec);
> +    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec);
> +    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec);
> +    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec);
> +    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec);
> +    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);
>      __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major);
>      __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);
>      __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major);
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] linux-user: fix translation of statx structures
  2019-11-22 18:27 ` Aleksandar Markovic
  2019-11-22 19:41   ` Philippe Mathieu-Daudé
@ 2019-11-22 21:26   ` Ariadne Conill
  1 sibling, 0 replies; 6+ messages in thread
From: Ariadne Conill @ 2019-11-22 21:26 UTC (permalink / raw)
  To: Aleksandar Markovic; +Cc: Riku Voipio, Laurent Vivier, QEMU Developers

Hello,

On Fri, Nov 22, 2019 at 12:27 PM Aleksandar Markovic
<aleksandar.m.mail@gmail.com> wrote:
>
> On Fri, Nov 22, 2019 at 7:22 PM Ariadne Conill <ariadne@dereferenced.org> wrote:
> >
> > All timestamps were copied to atime instead of to their respective
> > fields.
> >
> > Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> > ---
>
> What a bug.

Yes, in Alpine qemu+binfmt_misc+chroot environment, this bug caused
all files to have an observed mtime set to the UNIX epoch, which
caused problems with building Autoconf-based applications.  This
really irked me so I took the time to dig into it.

>
> Laurent, perhaps a good candidate for 4.2?
>
> Thanks for submitting this, Ariadne Conill!

Not a problem.

Ariadne


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] linux-user: fix translation of statx structures
  2019-11-22 17:40 [PATCH] linux-user: fix translation of statx structures Ariadne Conill
  2019-11-22 18:27 ` Aleksandar Markovic
  2019-11-22 20:30 ` Laurent Vivier
@ 2019-11-25  8:42 ` Laurent Vivier
  2 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2019-11-25  8:42 UTC (permalink / raw)
  To: Ariadne Conill, riku.voipio; +Cc: qemu-devel

Le 22/11/2019 à 18:40, Ariadne Conill a écrit :
> All timestamps were copied to atime instead of to their respective
> fields.
> 
> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> ---
>  linux-user/syscall.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index ce399a55f0..171c0caef3 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,
>      __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);
>      __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);
>      __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> -    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
> -    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec);
> +    __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec);
> +    __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec);
> +    __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec);
> +    __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec);
> +    __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec);
> +    __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);
>      __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major);
>      __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);
>      __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major);
> 

Applied to my linux-user branch for 4.2.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-25  8:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-22 17:40 [PATCH] linux-user: fix translation of statx structures Ariadne Conill
2019-11-22 18:27 ` Aleksandar Markovic
2019-11-22 19:41   ` Philippe Mathieu-Daudé
2019-11-22 21:26   ` Ariadne Conill
2019-11-22 20:30 ` Laurent Vivier
2019-11-25  8:42 ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).