Skip to contentSkip to conversation

Fix POSIX skin build for 2.4.x

PATCH In review Jan Kiszka 2 participants 2 messages Feb 21, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Fix POSIX skin build for 2.4.x

Hi Gilles,

the backport from trunk was borken. This patch makes 2.4.x build again, but - BIG-FAT-WARNING - I haven't tested the result.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
ksrc/skins/posix/syscall.c +8 -6
Index: xenomai-2.4.x/ksrc/skins/posix/syscall.c
===================================================================
@@ -1847,7 +1847,7 @@ static int __mq_send(struct task_struct 
 	if (IS_ERR(msg))
 		return PTR_ERR(msg);
 
-	if(__xn_copy_from_user(msg->data,
+	if(__xn_copy_from_user(curr, msg->data,
 			       (void __user *)__xn_reg_arg2(regs), len)) {
 		pse51_mq_finish_send(ufd->kfd, mq, msg);
 		return -EFAULT;
@@ -1903,7 +1903,7 @@ static int __mq_timedsend(struct task_st
 	if (IS_ERR(msg))
 		return PTR_ERR(msg);
 
-	if(__xn_copy_from_user(msg->data,
+	if(__xn_copy_from_user(curr, msg->data,
 			       (void __user *)__xn_reg_arg2(regs), len)) {
 		pse51_mq_finish_send(ufd->kfd, mq, msg);
 		return -EFAULT;
@@ -1952,7 +1952,7 @@ static int __mq_receive(struct task_stru
 	if (IS_ERR(msg))
 		return PTR_ERR(msg);
 
-	if (__xn_copy_to_user((void __user *)__xn_reg_arg2(regs),
+	if (__xn_copy_to_user(curr, (void __user *)__xn_reg_arg2(regs),
 			      msg->data, msg->len)) {
 		pse51_mq_finish_rcv(ufd->kfd, mq, msg);
 		return -EFAULT;
@@ -2029,7 +2029,7 @@ static int __mq_timedreceive(struct task
 	if (IS_ERR(msg))
 		return PTR_ERR(msg);
 
-	if (__xn_copy_to_user((void __user *)__xn_reg_arg2(regs),
+	if (__xn_copy_to_user(curr, (void __user *)__xn_reg_arg2(regs),
 			      msg->data, msg->len)) {
 		pse51_mq_finish_rcv(ufd->kfd, mq, msg);
 		return -EFAULT;
@@ -2041,8 +2041,10 @@ static int __mq_timedreceive(struct task
 	if (err)
 		return err;
 
-	if (__xn_safe_copy_to_user((void __user *)__xn_reg_arg3(regs),
-				   &len, sizeof(len)))
+	if (!__xn_access_ok
+	    (curr, VERIFY_WRITE, __xn_reg_arg3(regs), sizeof(len)) ||
+	    __xn_copy_to_user(curr, (void __user *)__xn_reg_arg3(regs),
+			      &len, sizeof(len)))
 		return -EFAULT;
 
 	if (__xn_reg_arg4(regs))
#1 lore raw
Quoted 4 lines · Jan Kiszka

Hi Gilles,

the backport from trunk was borken. This patch makes 2.4.x build again, but - BIG-FAT-WARNING - I haven't tested the result.

I was almost sure I added the additional argument to xn_copy_from/to_user. It appears I did not. Anyway, I will apply your patch, thanks.

Signature · 1 line
 Gilles Chanteperdrix