Skip to contentSkip to conversation

patch for IA64: fix do_sys32_msgrcv bad address error.

Linux-ia64 Don Dugger 4 participants 4 messages Sep 5, 2002 – Sep 6, 2002

lore
Share & tools
lore

Don Dugger

author
#0 lore raw

Yes, but Dave Millier claims that this patch is still broken, he says the fix needs to be in `ipc_kludge'. I don't have access to my source tree until this evening, have you looked at this?

Quoted 47 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · R Sreelatha

R> In sys_ia32.c file, in the do_sys32_msgrcv() function call, the R> value of ipck.msgp is interpreted as a 64 bit address, whereas it R> is a 32 bit address. Hence, do_sys32_msgrcv() finally returns R> EFAULT(bad address) error. The patch below takes care of this by R> type casting ipck.msgp to type u32. The patch is created for R> 2.5.32 version of the kernel.

Yes, this was obviously broken. I committed the attached patch to my 2.5 tree.

	--david

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.532 -> 1.533
# arch/ia64/ia32/sys_ia32.c 1.18 -> 1.19
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/05 [email protected] 1.533
# ia64: Fix x86 struct ipc_kludge (reported by R Sreelatha, fix proposed by
# Dave Miller).
# --------------------------------------------
#
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c

arch/ia64/ia32/sys_ia32.c +2 -2
@@ -2111,8 +2111,8 @@
 };
 
 struct ipc_kludge {
-	struct msgbuf *msgp;
-	long msgtyp;
+	u32 msgp;
+	s32 msgtyp;
 };
 
 #define SEMOP		 1

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · R Sreelatha

R> In sys_ia32.c file, in the do_sys32_msgrcv() function call, the R> value of ipck.msgp is interpreted as a 64 bit address, whereas it R> is a 32 bit address. Hence, do_sys32_msgrcv() finally returns R> EFAULT(bad address) error. The patch below takes care of this by R> type casting ipck.msgp to type u32. The patch is created for R> 2.5.32 version of the kernel.

Yes, this was obviously broken. I committed the attached patch to my 2.5 tree.

	--david

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.532 -> 1.533
# arch/ia64/ia32/sys_ia32.c 1.18 -> 1.19
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/05 [email protected] 1.533
# ia64: Fix x86 struct ipc_kludge (reported by R Sreelatha, fix proposed by
# Dave Miller).
# --------------------------------------------
#

arch/ia64/ia32/sys_ia32.c +2 -2
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
@@ -2111,8 +2111,8 @@
 };
 
 struct ipc_kludge {
-	struct msgbuf *msgp;
-	long msgtyp;
+	u32 msgp;
+	s32 msgtyp;
 };
 
 #define SEMOP		 1
#2 lore raw

Re: [Linux-ia64] Re: patch for IA64: fix do_sys32_msgrcv bad

In reply to Don Dugger

From: Don Dugger <[email protected]>
Date: Thu, 5 Sep 2002 10:43:12 -0600

Yes, but Dave Millier claims that this patch is still broken, he says the fix needs to be in `ipc_kludge'. I don't have access to my source tree until this evening, have you looked at this?

You didn't read David's patch at all, this is exactly what he is doing, fixing the ipc_kludge declaration.

Quoted 4 lines · David Mosberger

diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c

arch/ia64/ia32/sys_ia32.c line 2118

Quoted 10 lines
arch/ia64/ia32/sys_ia32.c +2 -2
@@ -2111,8 +2111,8 @@
 };
 
 struct ipc_kludge {
-	struct msgbuf *msgp;
-	long msgtyp;
+	u32 msgp;
+	s32 msgtyp;
 };
 
 #define SEMOP		 1

See?

#3 lore raw
In reply to Don Dugger

David,
Thanks. Yes, changing the types in the ipc_kludge structure would be
correct way to patch. I have incorporated the change suggested by you in my code patch.

regards,
Sreelatha

"David S. Miller"
<[email protected] To: [email protected]
> cc: [email protected], R Sreelatha/India/IBM@IBMIN,
[email protected], [email protected]
09/06/2002 08:49 Subject: Re: [Linux-ia64] Re: patch for IA64: fix
AM do_sys32_msgrcv bad address error.

From: Don Dugger <[email protected]>
Date: Thu, 5 Sep 2002 10:43:12 -0600

Yes, but Dave Millier claims that this patch is still broken, he says
the
fix needs to be in `ipc_kludge'. I don't have access to my source tree until this evening, have you looked at this?

You didn't read David's patch at all, this is exactly what he is doing, fixing the ipc_kludge declaration.

Quoted 4 lines · David Mosberger

diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c

arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002 line 2118

Quoted 10 lines
arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002 +2 -2
@@ -2111,8 +2111,8 @@
 };
 
 struct ipc_kludge {
-             struct msgbuf *msgp;
-             long msgtyp;
+             u32 msgp;
+             s32 msgtyp;
 };
 
 #define SEMOP                         1

See?