Re: [RFC][v5][PATCH 8/8]: Define clone_with_pids() syscall

From: Nathan Lynch
Date: Tue Sep 08 2009 - 14:19:36 EST


Suka,

I ran across an issue with this on ppc64.

> +static pid_t *copy_target_pids(void __user *upid_setp)
> +{
> + int j;
> + int rc;
> + int size;
> + int unum_pids; /* # of pids specified by user */
> + int knum_pids; /* # of pids needed in kernel */
> + pid_t *target_pids;
> + struct pid_set pid_set;
> +
> + if (!upid_setp)
> + return NULL;
> +
> + rc = copy_from_user(&pid_set, upid_setp, sizeof(pid_set));

This doesn't work on a 64-bit kernel when the process is 32-bit and uses
the definition of struct pid_set provided in types.h:

+struct pid_set {
+ int num_pids;
+ pid_t *pids;
+};

Shouldn't the pids field be u64 or some other type of fixed size?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/