Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Wed, 25 Mar 2009
 10:05:58 -0700
Received: from psmtp.com ([64.18.0.49]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Wed, 25 Mar 2009 10:05:57 -0700
Received: from source ([213.58.128.207]) by exprod5mx254.postini.com
 ([64.18.4.13]) with SMTP;	Wed, 25 Mar 2009 09:05:57 PST
Received: from localhost.localdomain ([127.0.0.1]:47777 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP	id S20023761AbZCYREq
 (ORCPT <rfc822;andy.sharp@onstor.com>);	Wed, 25 Mar 2009 17:04:46 +0000
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 25 Mar 2009 17:04:29
 +0000 (GMT)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:35884 "EHLO
	mail3.caviumnetworks.com") by ftp.linux-mips.org with ESMTP	id
 S20022077AbZCYREX (ORCPT <rfc822;linux-mips@linux-mips.org>);	Wed, 25 Mar
 2009 17:04:23 +0000
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by
 mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503)	id <B49ca63980000>;
 Wed, 25 Mar 2009 13:02:21 -0400
Received: from exch4.caveonetworks.com ([192.168.16.23]) by
 exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);	 Wed, 25 Mar
 2009 10:01:49 -0700
Received: from dd1.caveonetworks.com ([64.169.86.201]) by
 exch4.caveonetworks.com over TLS secured channel with Microsoft
 SMTPSVC(6.0.3790.3959);	 Wed, 25 Mar 2009 10:01:49 -0700
Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1])	by
 dd1.caveonetworks.com (8.14.2/8.14.2) with ESMTP id n2PH1jjJ026906;	Wed, 25
 Mar 2009 10:01:45 -0700
Received: (from ddaney@localhost)	by dd1.caveonetworks.com
 (8.14.2/8.14.2/Submit) id n2PH1ibX026905;	Wed, 25 Mar 2009 10:01:44 -0700
From: David Daney <ddaney@caviumnetworks.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
CC: David Daney <ddaney@caviumnetworks.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Wed, 25 Mar 2009 10:01:44 -0700
Subject: [PATCH] MIPS: Mask sys_llseek offsets in 32-bit syscalls.
Thread-Topic: [PATCH] MIPS: Mask sys_llseek offsets in 32-bit syscalls.
Thread-Index: Acmta/e2tuoMUilxS6aTQrD+lmP6Xg==
Message-ID: <1238000504-26881-1-git-send-email-ddaney@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 25 Mar 2009 17:01:49.0648 (UTC)
 FILETIME=[63565D00:01C9AD6B]
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:53.93951/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-neptune: 3/1/0.33/77
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
x-ems-stamp: VfWxQhyzOD6RtKigf5XvpA==
x-list: linux-mips
x-archive-position: 22150
x-ecartis-version: Ecartis v1.0.0
x-original-sender: ddaney@caviumnetworks.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

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);
 }
=20
 /* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
--=20
1.6.0.6


