projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31d5119
)
protect get_user_pages with mmap_sem
before_interruptible
author
Miklos Szeredi
<miklos@szeredi.hu>
Tue, 7 Dec 2004 20:13:47 +0000
(20:13 +0000)
committer
Miklos Szeredi
<miklos@szeredi.hu>
Tue, 7 Dec 2004 20:13:47 +0000
(20:13 +0000)
kernel/file.c
patch
|
blob
|
history
diff --git
a/kernel/file.c
b/kernel/file.c
index 11a7ee828a0c417fd5979372edccb29c5ddc3aae..738f1f030518066b2e688e053cd9806cbac8a9aa 100644
(file)
--- a/
kernel/file.c
+++ b/
kernel/file.c
@@
-658,8
+658,10
@@
static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
npages = min(npages, FUSE_MAX_PAGES_PER_REQ);
+ down_read(¤t->mm->mmap_sem);
npages = get_user_pages(current, current->mm, user_addr, npages, write,
0, req->pages, NULL);
+ up_read(¤t->mm->mmap_sem);
if (npages < 0)
return npages;