PATCH: sched_{s,g}etaffinity compat

Marcus Meissner meissner at suse.de
Tue May 11 00:57:29 EST 2004


Hi Anton, folks,

My testcase returns EFAULT for getaffinity, I suspect this is the problem:

  +			err = access_ok(VERIFY_WRITE, user_mask_ptr, ret);

This should be a !access_ok( if you ask me.

  +
  +			k = &cpus_coerce(kernel_mask);
  +
  +			for (i=0; i < sizeof(kernel_mask)/sizeof(m) && !err; i++) {
  +				m = *k++;
  +
  +				for (j = 0; j < sizeof(m)/sizeof(compat_ulong_t) && !err; j++ ) {
  +					um = m;
  +					err |= __put_user(um, user_mask_ptr);
  +					user_mask_ptr++;
  +					m >>= 4*sizeof(compat_ulong_t);
  +					m >>= 4*sizeof(compat_ulong_t);
  +				}
  +			}
  +			if (err)
  +				ret = -EFAULT;
  +		}

Ciao, Marcus

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list