Re: linux-next: manual merge of the compat tree with the tree

From: Mark Brown
Date: Fri Mar 14 2014 - 14:44:11 EST


On Fri, Mar 14, 2014 at 06:36:53PM +0000, Mark Brown wrote:

> Today's linux-next merge of the compat tree got a conflict in between
> commit 81993e81a99 ("compat: Get rid of
> (get|put)_compat_time(val|spec)") from the tip tree and commit
> 932602e23832 ("fs/compat: convert to COMPAT_SYSCALL_DEFINE with
> changing parameter types") from the compat tree.

> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

And essentially the same thing in ipc/compat_mq.c:

diff --cc ipc/compat_mq.c
index a9cf16378d7a,d58747293772..000000000000
--- a/ipc/compat_mq.c
+++ b/ipc/compat_mq.c
@@@ -64,10 -64,24 +64,10 @@@ COMPAT_SYSCALL_DEFINE4(mq_open, const c
return sys_mq_open(u_name, oflag, mode, p);
}

- asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
- const char __user *u_msg_ptr,
- size_t msg_len, unsigned int msg_prio,
- const struct compat_timespec __user *u_abs_timeout)
-static int compat_prepare_timeout(struct timespec __user **p,
- const struct compat_timespec __user *u)
-{
- struct timespec ts;
- if (!u) {
- *p = NULL;
- return 0;
- }
- *p = compat_alloc_user_space(sizeof(ts));
- if (get_compat_timespec(&ts, u) || copy_to_user(*p, &ts, sizeof(ts)))
- return -EFAULT;
- return 0;
-}
-
+ COMPAT_SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes,
+ const char __user *, u_msg_ptr,
+ compat_size_t, msg_len, unsigned int, msg_prio,
+ const struct compat_timespec __user *, u_abs_timeout)
{
struct timespec __user *u_ts;

@@@ -78,14 -92,13 +78,14 @@@
msg_prio, u_ts);
}

- asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
- char __user *u_msg_ptr,
- size_t msg_len, unsigned int __user *u_msg_prio,
- const struct compat_timespec __user *u_abs_timeout)
+ COMPAT_SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes,
+ char __user *, u_msg_ptr,
+ compat_size_t, msg_len, unsigned int __user *, u_msg_prio,
+ const struct compat_timespec __user *, u_abs_timeout)
{
struct timespec __user *u_ts;
- if (compat_prepare_timeout(&u_ts, u_abs_timeout))
+
+ if (compat_convert_timespec(&u_ts, u_abs_timeout))
return -EFAULT;

return sys_mq_timedreceive(mqdes, u_msg_ptr, msg_len,

Attachment: signature.asc
Description: Digital signature