Re: [PATCH 17/27] add generic lib/checksum.c

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

 



Arnd Bergmann wrote:
> On Friday 01 May 2009, Russell King wrote:
>> Since when has 'memcpy' been valid from user addresses?
> 
> It's an artifact from the microblaze code, I found it after
> submitting the patches when running sparse over it (yes, I
> know I should do these things in a different order).
> 
> The s390 version seems to get this right, so I'll use this:
> 
> static inline __wsum
> csum_partial_copy_from_user(const void __user *src, void *dst,
>                                           int len, __wsum sum,
>                                           int *err_ptr)
> {
> 	int missing;
> 
> 	missing = copy_from_user(dst, src, len);
> 	if (missing) {
> 		memset(dst + len - missing, 0, missing);
> 		*err_ptr = -EFAULT;
> 	}
> 
> 	return csum_partial(dst, len, sum);
> }
> 
> On microblaze, the old code was only correct for NOMMU.

Not it wasn't there were address space problem too.

Michal

> 
> Thanks,
> 
> 	Arnd <><


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux