Skip to content

Commit 4f380dc

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.61' into linux-linaro-lsk-v4.4
This is the 4.4.61 stable release
2 parents d245428 + ec5e616 commit 4f380dc

28 files changed

Lines changed: 344 additions & 318 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 60
3+
SUBLEVEL = 61
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/arm/kvm/mmu.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,13 +803,15 @@ void stage2_unmap_vm(struct kvm *kvm)
803803
int idx;
804804

805805
idx = srcu_read_lock(&kvm->srcu);
806+
down_read(&current->mm->mmap_sem);
806807
spin_lock(&kvm->mmu_lock);
807808

808809
slots = kvm_memslots(kvm);
809810
kvm_for_each_memslot(memslot, slots)
810811
stage2_unmap_memslot(kvm, memslot);
811812

812813
spin_unlock(&kvm->mmu_lock);
814+
up_read(&current->mm->mmap_sem);
813815
srcu_read_unlock(&kvm->srcu, idx);
814816
}
815817

@@ -1771,6 +1773,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
17711773
(KVM_PHYS_SIZE >> PAGE_SHIFT))
17721774
return -EFAULT;
17731775

1776+
down_read(&current->mm->mmap_sem);
17741777
/*
17751778
* A memory region could potentially cover multiple VMAs, and any holes
17761779
* between them, so iterate over all of them to find out if we can map
@@ -1814,8 +1817,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
18141817
pa += vm_start - vma->vm_start;
18151818

18161819
/* IO region dirty page logging not allowed */
1817-
if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES)
1818-
return -EINVAL;
1820+
if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES) {
1821+
ret = -EINVAL;
1822+
goto out;
1823+
}
18191824

18201825
ret = kvm_phys_addr_ioremap(kvm, gpa, pa,
18211826
vm_end - vm_start,
@@ -1827,14 +1832,16 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
18271832
} while (hva < reg_end);
18281833

18291834
if (change == KVM_MR_FLAGS_ONLY)
1830-
return ret;
1835+
goto out;
18311836

18321837
spin_lock(&kvm->mmu_lock);
18331838
if (ret)
18341839
unmap_stage2_range(kvm, mem->guest_phys_addr, mem->memory_size);
18351840
else
18361841
stage2_flush_memslot(kvm, memslot);
18371842
spin_unlock(&kvm->mmu_lock);
1843+
out:
1844+
up_read(&current->mm->mmap_sem);
18381845
return ret;
18391846
}
18401847

arch/metag/include/asm/uaccess.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,21 @@ extern long __must_check strnlen_user(const char __user *src, long count);
197197

198198
#define strlen_user(str) strnlen_user(str, 32767)
199199

200-
extern unsigned long __must_check __copy_user_zeroing(void *to,
201-
const void __user *from,
202-
unsigned long n);
200+
extern unsigned long raw_copy_from_user(void *to, const void __user *from,
201+
unsigned long n);
203202

204203
static inline unsigned long
205204
copy_from_user(void *to, const void __user *from, unsigned long n)
206205
{
206+
unsigned long res = n;
207207
if (likely(access_ok(VERIFY_READ, from, n)))
208-
return __copy_user_zeroing(to, from, n);
209-
memset(to, 0, n);
210-
return n;
208+
res = raw_copy_from_user(to, from, n);
209+
if (unlikely(res))
210+
memset(to + (n - res), 0, res);
211+
return res;
211212
}
212213

213-
#define __copy_from_user(to, from, n) __copy_user_zeroing(to, from, n)
214+
#define __copy_from_user(to, from, n) raw_copy_from_user(to, from, n)
214215
#define __copy_from_user_inatomic __copy_from_user
215216

216217
extern unsigned long __must_check __copy_user(void __user *to,

0 commit comments

Comments
 (0)