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

Nathan Lynch ntl at pobox.com
Tue Sep 8 11:19:08 PDT 2009


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?
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list