Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14776
b: refs/heads/master
c: 5d2a2db
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 29, 2005
1 parent 43b68ca commit 52062fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9cfcddfd65735437a4cb8563d6b66a6da8a5ed6
refs/heads/master: 5d2a2dbbc1025dbf7998b9289574d9592b8f21cc
11 changes: 9 additions & 2 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,15 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
*/
if (unlikely(!src)) {
void *kaddr = kmap_atomic(dst, KM_USER0);
unsigned long left = __copy_from_user_inatomic(kaddr, (void __user *)va, PAGE_SIZE);
if (left)
void __user *uaddr = (void __user *)(va & PAGE_MASK);

/*
* This really shouldn't fail, because the page is there
* in the page tables. But it might just be unreadable,
* in which case we just give up and fill the result with
* zeroes.
*/
if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
memset(kaddr, 0, PAGE_SIZE);
kunmap_atomic(kaddr, KM_USER0);
return;
Expand Down

0 comments on commit 52062fb

Please sign in to comment.