| To: | linux-mips@linux-mips.org, ralf@linux-mips.org |
|---|---|
| Subject: | [PATCH] MIPS: Mask sys_llseek offsets in 32-bit syscalls. |
| From: | David Daney <ddaney@caviumnetworks.com> |
| Date: | Wed, 25 Mar 2009 10:01:44 -0700 |
| Cc: | David Daney <ddaney@caviumnetworks.com> |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
The o32 user space ABI sign extends the offset values. We need to
undo this by masking out the high bits.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
arch/mips/kernel/linux32.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 49aac6e..13fc173 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -137,7 +137,8 @@ SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned
long, offset_high,
unsigned long, offset_low, loff_t __user *, result,
unsigned long, origin)
{
- return sys_llseek(fd, offset_high, offset_low, result, origin);
+ return sys_llseek(fd, offset_high & 0xffffffff,
+ offset_low & 0xffffffff, result, origin);
}
/* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
--
1.6.0.6
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 5/6] Alchemy: don't unconditionally register all alchemy platform devices, Manuel Lauss |
|---|---|
| Next by Date: | Re: [PATCH 2/2] MIPS: o32: Get rid of useless wrapper for llseek, Heiko Carstens |
| Previous by Thread: | [PATCH 0/6] Alchemy updates for 2.6.30, Manuel Lauss |
| Next by Thread: | Re: [PATCH][MIPS] Use CP0 Count register to implement more granular ndelay, David VomLehn |
| Indexes: | [Date] [Thread] [Top] [All Lists] |