Re: [PATCH v2 21/29] nios2: Futex operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Jul 2014, Ley Foon Tan wrote:
 +static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr,
> +					   int *oldval)
> +{
> +	unsigned long flags;
> +	int ret;
> +
> +	local_irq_save(flags);
> +
> +	ret = get_user(*oldval, uaddr);
> +	if (!ret)
> +		ret = put_user(oparg, uaddr);

This is wrong as it gets. get_user() might fault and sleep.

You need a proper implementation, which handles fault exceptions.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux