* patch for IA64: fix do_sys32_msgrcv bad address error.
@ 2002-09-05 14:16 R Sreelatha
2002-09-05 14:26 ` David S. Miller
2002-09-05 16:51 ` David Mosberger
0 siblings, 2 replies; 6+ messages in thread
From: R Sreelatha @ 2002-09-05 14:16 UTC (permalink / raw)
To: linux-kernel
In sys_ia32.c file, in the do_sys32_msgrcv() function call, the value of
ipck.msgp is interpreted as a 64 bit address, whereas it is a 32 bit
address.
Hence, do_sys32_msgrcv() finally returns EFAULT(bad address) error.
The patch below takes care of this by type casting ipck.msgp to type u32.
The patch is created for 2.5.32 version of the kernel.
--- arch/ia64/ia32/sys_ia32.c Thu Sep 5 19:13:02 2002
+++ /home/sree/bug1054/sys_ia32.c Thu Sep 5 19:12:08 2002
@@ -2263,7 +2263,7 @@
err = -EFAULT;
if (copy_from_user(&ipck, uipck, sizeof(struct ipc_kludge)))
goto out;
- uptr = (void *)A(ipck.msgp);
+ uptr = (void *)A((u32)ipck.msgp);
msgtyp = ipck.msgtyp;
}
err = -ENOMEM;
I am not subscribed to lkml. Please send your replies to
"rsreelat@in.ibm.com".
regards,
Sreelatha
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: patch for IA64: fix do_sys32_msgrcv bad address error.
2002-09-05 14:16 patch for IA64: fix do_sys32_msgrcv bad address error R Sreelatha
@ 2002-09-05 14:26 ` David S. Miller
2002-09-05 16:51 ` David Mosberger
1 sibling, 0 replies; 6+ messages in thread
From: David S. Miller @ 2002-09-05 14:26 UTC (permalink / raw)
To: rsreelat; +Cc: linux-kernel
From: "R Sreelatha" <rsreelat@in.ibm.com>
Date: Thu, 5 Sep 2002 19:46:40 +0530
In sys_ia32.c file, in the do_sys32_msgrcv() function call, the value of
ipck.msgp is interpreted as a 64 bit address, whereas it is a 32 bit
address.
Hence, do_sys32_msgrcv() finally returns EFAULT(bad address) error.
The patch below takes care of this by type casting ipck.msgp to type u32.
The patch is created for 2.5.32 version of the kernel.
It's still broken.
Fix this instead by declaring ipc_kludge with the proper
32-bit types. This is why the identical code works on
sparc64 for sparc32 emulation. :-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Linux-ia64] Re: patch for IA64: fix do_sys32_msgrcv bad address error.
2002-09-05 16:51 ` David Mosberger
@ 2002-09-05 16:43 ` Don Dugger
2002-09-06 3:19 ` David S. Miller
0 siblings, 1 reply; 6+ messages in thread
From: Don Dugger @ 2002-09-05 16:43 UTC (permalink / raw)
To: davidm; +Cc: R Sreelatha, linux-ia64, davem, linux-kernel
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?
On Thu, Sep 05, 2002 at 09:51:48AM -0700, David Mosberger wrote:
> >>>>> On Thu, 5 Sep 2002 19:46:40 +0530, "R Sreelatha" <rsreelat@in.ibm.com> said:
>
> 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 davidm@tiger.hpl.hp.com 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
> --- a/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> +++ b/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> @@ -2111,8 +2111,8 @@
> };
>
> struct ipc_kludge {
> - struct msgbuf *msgp;
> - long msgtyp;
> + u32 msgp;
> + s32 msgtyp;
> };
>
> #define SEMOP 1
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@n0ano.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: patch for IA64: fix do_sys32_msgrcv bad address error.
2002-09-05 14:16 patch for IA64: fix do_sys32_msgrcv bad address error R Sreelatha
2002-09-05 14:26 ` David S. Miller
@ 2002-09-05 16:51 ` David Mosberger
2002-09-05 16:43 ` [Linux-ia64] " Don Dugger
1 sibling, 1 reply; 6+ messages in thread
From: David Mosberger @ 2002-09-05 16:51 UTC (permalink / raw)
To: R Sreelatha; +Cc: linux-ia64, davem, linux-kernel
>>>>> On Thu, 5 Sep 2002 19:46:40 +0530, "R Sreelatha" <rsreelat@in.ibm.com> said:
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 davidm@tiger.hpl.hp.com 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
--- a/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
+++ b/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
@@ -2111,8 +2111,8 @@
};
struct ipc_kludge {
- struct msgbuf *msgp;
- long msgtyp;
+ u32 msgp;
+ s32 msgtyp;
};
#define SEMOP 1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Linux-ia64] Re: patch for IA64: fix do_sys32_msgrcv bad address error.
2002-09-05 16:43 ` [Linux-ia64] " Don Dugger
@ 2002-09-06 3:19 ` David S. Miller
0 siblings, 0 replies; 6+ messages in thread
From: David S. Miller @ 2002-09-06 3:19 UTC (permalink / raw)
To: n0ano; +Cc: davidm, rsreelat, linux-ia64, linux-kernel
From: Don Dugger <n0ano@n0ano.com>
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.
On Thu, Sep 05, 2002 at 09:51:48AM -0700, David Mosberger wrote:
> diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
> --- a/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> +++ b/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> @@ -2111,8 +2111,8 @@
> };
>
> struct ipc_kludge {
> - struct msgbuf *msgp;
> - long msgtyp;
> + u32 msgp;
> + s32 msgtyp;
> };
>
> #define SEMOP 1
See?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Linux-ia64] Re: patch for IA64: fix do_sys32_msgrcv bad address error.
@ 2002-09-06 3:57 R Sreelatha
0 siblings, 0 replies; 6+ messages in thread
From: R Sreelatha @ 2002-09-06 3:57 UTC (permalink / raw)
To: David S. Miller; +Cc: davidm, linux-ia64, linux-kernel, n0ano
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"
<davem@redhat.com To: n0ano@n0ano.com
> cc: davidm@hpl.hp.com, R Sreelatha/India/IBM@IBMIN,
linux-ia64@linuxia64.org, linux-kernel@vger.kernel.org
09/06/2002 08:49 Subject: Re: [Linux-ia64] Re: patch for IA64: fix
AM do_sys32_msgrcv bad address error.
From: Don Dugger <n0ano@n0ano.com>
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.
On Thu, Sep 05, 2002 at 09:51:48AM -0700, David Mosberger wrote:
> diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
> --- a/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> +++ b/arch/ia64/ia32/sys_ia32.c Thu Sep 5 09:51:05 2002
> @@ -2111,8 +2111,8 @@
> };
>
> struct ipc_kludge {
> - struct msgbuf *msgp;
> - long msgtyp;
> + u32 msgp;
> + s32 msgtyp;
> };
>
> #define SEMOP 1
See?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-09-06 4:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 14:16 patch for IA64: fix do_sys32_msgrcv bad address error R Sreelatha
2002-09-05 14:26 ` David S. Miller
2002-09-05 16:51 ` David Mosberger
2002-09-05 16:43 ` [Linux-ia64] " Don Dugger
2002-09-06 3:19 ` David S. Miller
2002-09-06 3:57 R Sreelatha
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).