Skip to contentSkip to conversation

uml: fix one compile error

PATCH In review Américo Wang 3 participants 5 messages Oct 16, 2008 – Oct 17, 2008 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uml: fix one compile error

This patch fixed the following compile error:

CC arch/um/sys-i386/signal.o
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c: In
function 'copy_sc_from_user':
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
warning: dereferencing 'void *' pointer /home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
error: request for member '_fxsr_env' in something not a structure or union

---

arch/um/sys-i386/signal.c +2 -1
index fd0c25a..1296473 100644
@@ -179,7 +179,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
 	if (have_fpx_regs) {
 		struct user_fxsr_struct fpx;
 
-		err = copy_from_user(&fpx, &sc.fpstate->_fxsr_env[0],
+		err = copy_from_user(&fpx,
+			&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
 				     sizeof(struct user_fxsr_struct));
 		if (err)
 			return 1;
#1 lore raw
Quoted 22 lines · On Thu, 16 Oct 2008 16:26:26 +0100 Am__rico Wang <[email protected]>…

This patch fixed the following compile error:

CC arch/um/sys-i386/signal.o
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c: In
function 'copy_sc_from_user':
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
warning: dereferencing 'void *' pointer /home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
error: request for member '_fxsr_env' in something not a structure or union

---

arch/um/sys-i386/signal.c +0 -0
index fd0c25a..1296473 100644

arch/um/sys-i386/signal.c static int copy_sc_from_user(struct pt_regs *regs, · line 186

Quoted 9 lines
arch/um/sys-i386/signal.c +2 -1
@@ -179,7 +179,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
 	if (have_fpx_regs) {
 		struct user_fxsr_struct fpx;
 
-		err = copy_from_user(&fpx, &sc.fpstate->_fxsr_env[0],
+		err = copy_from_user(&fpx,
+			&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
 				     sizeof(struct user_fxsr_struct));
 		if (err)
 			return 1;

Which kernel versions are affected by this error? 2.6.27?

Thanks.

#2 lore raw
Quoted 28 lines · Andrew Morton
Quoted 25 lines · On Thu, 16 Oct 2008 16:26:26 +0100 Am__rico Wang <[email protected]>…

This patch fixed the following compile error:

CC arch/um/sys-i386/signal.o
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c: In
function 'copy_sc_from_user':
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
warning: dereferencing 'void *' pointer /home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
error: request for member '_fxsr_env' in something not a structure or union

---

arch/um/sys-i386/signal.c +0 -0
index fd0c25a..1296473 100644
@@ -179,7 +179,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
 	if (have_fpx_regs) {
 		struct user_fxsr_struct fpx;
 
Quoted 8 lines

arch/um/sys-i386/signal.c static int copy_sc_from_user(struct pt_regs *regs, · line 186

Quoted 6 lines
arch/um/sys-i386/signal.c +2 -1
-		err = copy_from_user(&fpx, &sc.fpstate->_fxsr_env[0],
+		err = copy_from_user(&fpx,
+			&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
 				     sizeof(struct user_fxsr_struct));
 		if (err)
 			return 1;

Which kernel versions are affected by this error? 2.6.27?

I haven't tried a stable version, but I will. :)

Signature · 1 line
"Sometimes the only way to stay sane is to go a little crazy."
Tested-by
#3 lore raw
Quoted 38 lines · On Fri, 17 Oct 2008, =?utf-8?Q?Am=C3=A9rico?= Wang wrote:
Quoted 28 lines · Andrew Morton
Quoted 25 lines · On Thu, 16 Oct 2008 16:26:26 +0100 Am__rico Wang <[email protected]>…

This patch fixed the following compile error:

CC arch/um/sys-i386/signal.o
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c: In
function 'copy_sc_from_user':
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
warning: dereferencing 'void *' pointer /home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
error: request for member '_fxsr_env' in something not a structure or union

---

arch/um/sys-i386/signal.c +0 -0
index fd0c25a..1296473 100644
@@ -179,7 +179,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
 	if (have_fpx_regs) {
 		struct user_fxsr_struct fpx;
 
Quoted 8 lines

arch/um/sys-i386/signal.c static int copy_sc_from_user(struct pt_regs *regs, · line 186

Quoted 6 lines
arch/um/sys-i386/signal.c +2 -1
-		err = copy_from_user(&fpx, &sc.fpstate->_fxsr_env[0],
+		err = copy_from_user(&fpx,
+			&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
 				     sizeof(struct user_fxsr_struct));
 		if (err)
 			return 1;

Which kernel versions are affected by this error? 2.6.27?

Quoted 1 line

I haven't tried a stable version, but I will. :)

2.6.27 as UML works for me without the patch.

But it is needed for 2.6.28... thanks.

Miklos

#4 lore raw
Quoted 39 lines · Miklos Szeredi
Quoted 38 lines · On Fri, 17 Oct 2008, =?utf-8?Q?Am=C3=A9rico?= Wang wrote:
Quoted 36 lines · Andrew Morton
Quoted 22 lines · On Thu, 16 Oct 2008 16:26:26 +0100 Am__rico Wang <[email protected]>…

This patch fixed the following compile error:

CC arch/um/sys-i386/signal.o
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c: In
function 'copy_sc_from_user':
/home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
warning: dereferencing 'void *' pointer /home/wangcong/Projects/linux-2.6/arch/um/sys-i386/signal.c:182:
error: request for member '_fxsr_env' in something not a structure or union

---

arch/um/sys-i386/signal.c +0 -0
index fd0c25a..1296473 100644

arch/um/sys-i386/signal.c static int copy_sc_from_user(struct pt_regs *regs, · line 186

Quoted 9 lines
arch/um/sys-i386/signal.c +2 -1
@@ -179,7 +179,8 @@ static int copy_sc_from_user(struct pt_regs *regs,
 	if (have_fpx_regs) {
 		struct user_fxsr_struct fpx;
 
-		err = copy_from_user(&fpx, &sc.fpstate->_fxsr_env[0],
+		err = copy_from_user(&fpx,
+			&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
 				     sizeof(struct user_fxsr_struct));
 		if (err)
 			return 1;

Which kernel versions are affected by this error? 2.6.27?

Quoted 7 lines
Quoted 1 line

I haven't tried a stable version, but I will. :)

2.6.27 as UML works for me without the patch.

But it is needed for 2.6.28... thanks.

Thank you! :)

Signature · 1 line
"Sometimes the only way to stay sane is to go a little crazy."