mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
alpha: fix broken network checksum
The patch3ddc5b46a8
breaks networking on alpha (there is a follow-up fix5cfe8f1ba5
, but networking is still broken even with the second patch). The patch3ddc5b46a8
makes csum_partial_copy_from_user check the pointer with access_ok. However, csum_partial_copy_from_user is called also from csum_partial_copy_nocheck and csum_partial_copy_nocheck is called on kernel pointers and it is supposed not to check pointer validity. This bug results in ssh session hangs if the system is loaded and bulk data are printed to ssh terminal. This patch fixes csum_partial_copy_nocheck to call set_fs(KERNEL_DS), so that access_ok in csum_partial_copy_from_user accepts kernel-space addresses. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
a9302e8439
commit
0ef38d70d4
1 changed files with 7 additions and 2 deletions
|
@ -378,6 +378,11 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
|
|||
__wsum
|
||||
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
|
||||
{
|
||||
return csum_partial_copy_from_user((__force const void __user *)src,
|
||||
dst, len, sum, NULL);
|
||||
__wsum checksum;
|
||||
mm_segment_t oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
checksum = csum_partial_copy_from_user((__force const void __user *)src,
|
||||
dst, len, sum, NULL);
|
||||
set_fs(oldfs);
|
||||
return checksum;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue