From: Ulrich Hecht <uli@suse.de>
To: qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi
Subject: [Qemu-devel] [PATCH 7/7] linux-user: zero fstat buffer to initialize nsec fields
Date: Fri, 24 Jul 2009 19:10:32 +0200 [thread overview]
Message-ID: <1248455432-12959-8-git-send-email-uli@suse.de> (raw)
In-Reply-To: <1248455432-12959-7-git-send-email-uli@suse.de>
The fstat implementation does not initialize the nanosecond fields in the
stat buffer; this caused funny values to turn up there, preventing, for
instance, cp -p from preserving timestamps because utimensat rejected
the out-of-bounds nanosecond values. Resetting the entire structure
to zero fixes that.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2dc86ff..b413b08 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5523,6 +5523,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (!lock_user_struct(VERIFY_WRITE, target_st, arg2, 0))
goto efault;
+ memset(target_st, 0, sizeof(*target_st));
__put_user(st.st_dev, &target_st->st_dev);
__put_user(st.st_ino, &target_st->st_ino);
__put_user(st.st_mode, &target_st->st_mode);
--
1.6.2.1
next prev parent reply other threads:[~2009-07-24 17:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 17:10 [Qemu-devel] [PATCH 0/7] linux-user syscall fixes Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 1/7] linux-user: dup3, fallocate syscalls Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 2/7] linux-user: fcntl fixes for LTP Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 3/7] linux-user: enable getdents for > 32-bit systems Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 4/7] linux-user: define a couple of syscalls for non-uid16 targets Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 5/7] linux-user: getpriority errno fix Ulrich Hecht
2009-07-24 17:10 ` [Qemu-devel] [PATCH 6/7] linux-user: fadvise64 implementation Ulrich Hecht
2009-07-24 17:10 ` Ulrich Hecht [this message]
2009-07-25 22:37 ` [Qemu-devel] [PATCH 1/7] linux-user: dup3, fallocate syscalls Jan-Simon Möller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1248455432-12959-8-git-send-email-uli@suse.de \
--to=uli@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).