From: Arun Sharma <arun.sharma@intel.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] Fix unaligned faults in putstat64
Date: Fri, 10 Oct 2003 18:44:35 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106581266028930@msgid-missing> (raw)
[-- Attachment #1: Type: text/plain, Size: 78 bytes --]
This seems to be introduced by recent changes in 2.6.0-test series.
-Arun
[-- Attachment #2: putstat64-align.patch --]
[-- Type: text/plain, Size: 1252 bytes --]
--- linux-2.6.0-test7/arch/ia64/ia32/sys_ia32.c 2003-10-10 20:45:27.283410352 +0800
+++ linux-2.6.0-test7/arch/ia64/ia32/sys_ia32.c.new 2003-10-10 21:06:24.715035573 +0800
@@ -2486,11 +2486,14 @@
putstat64 (struct stat64 *ubuf, struct kstat *kbuf)
{
int err;
+ u64 hdev;
if (clear_user(ubuf, sizeof(*ubuf)))
return -EFAULT;
- err = __put_user(huge_encode_dev(kbuf->dev), &ubuf->st_dev);
+ hdev = huge_encode_dev(kbuf->dev);
+ err = __put_user(hdev, (u32*)&ubuf->st_dev);
+ err |= __put_user(hdev >> 32, ((u32*)&ubuf->st_dev) + 1);
err |= __put_user(kbuf->ino, &ubuf->__st_ino);
err |= __put_user(kbuf->ino, &ubuf->st_ino_lo);
err |= __put_user(kbuf->ino >> 32, &ubuf->st_ino_hi);
@@ -2498,7 +2501,9 @@
err |= __put_user(kbuf->nlink, &ubuf->st_nlink);
err |= __put_user(kbuf->uid, &ubuf->st_uid);
err |= __put_user(kbuf->gid, &ubuf->st_gid);
- err |= __put_user(huge_encode_dev(kbuf->rdev), &ubuf->st_rdev);
+ hdev = huge_encode_dev(kbuf->rdev);
+ err = __put_user(hdev, (u32*)&ubuf->st_rdev);
+ err |= __put_user(hdev >> 32, ((u32*)&ubuf->st_rdev) + 1);
err |= __put_user(kbuf->size, &ubuf->st_size_lo);
err |= __put_user((kbuf->size >> 32), &ubuf->st_size_hi);
err |= __put_user(kbuf->atime.tv_sec, &ubuf->st_atime);
reply other threads:[~2003-10-10 18:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=marc-linux-ia64-106581266028930@msgid-missing \
--to=arun.sharma@intel.com \
--cc=linux-ia64@vger.kernel.org \
/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