diff options
author | Christopher Yeoh <cyeoh@au1.ibm.com> | 2012-05-31 19:26:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 20:49:32 -0400 |
commit | ac34ebb3a67e699edcb5ac72f19d31679369dfaa (patch) | |
tree | 21785208005952128545c0d7804c2dddf177766f /include/linux/fs.h | |
parent | ee62c6b2dc93c09585b51fad18449dc5edb9977f (diff) |
aio/vfs: cleanup of rw_copy_check_uvector() and compat_rw_copy_check_uvector()
A cleanup of rw_copy_check_uvector and compat_rw_copy_check_uvector after
changes made to support CMA in an earlier patch.
Rather than having an additional check_access parameter to these
functions, the first paramater type is overloaded to allow the caller to
specify CHECK_IOVEC_ONLY which means check that the contents of the iovec
are valid, but do not check the memory that they point to. This is used
by process_vm_readv/writev where we need to validate that a iovec passed
to the syscall is valid but do not want to check the memory that it points
to at this point because it refers to an address space in another process.
Signed-off-by: Chris Yeoh <yeohc@au1.ibm.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 038076b27ea4..cf2c5611b19b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -173,6 +173,15 @@ struct inodes_stat_t { | |||
173 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) | 173 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) |
174 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 174 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
175 | 175 | ||
176 | |||
177 | /* | ||
178 | * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector | ||
179 | * that indicates that they should check the contents of the iovec are | ||
180 | * valid, but not check the memory that the iovec elements | ||
181 | * points too. | ||
182 | */ | ||
183 | #define CHECK_IOVEC_ONLY -1 | ||
184 | |||
176 | #define SEL_IN 1 | 185 | #define SEL_IN 1 |
177 | #define SEL_OUT 2 | 186 | #define SEL_OUT 2 |
178 | #define SEL_EX 4 | 187 | #define SEL_EX 4 |
@@ -1690,8 +1699,7 @@ struct seq_file; | |||
1690 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1699 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
1691 | unsigned long nr_segs, unsigned long fast_segs, | 1700 | unsigned long nr_segs, unsigned long fast_segs, |
1692 | struct iovec *fast_pointer, | 1701 | struct iovec *fast_pointer, |
1693 | struct iovec **ret_pointer, | 1702 | struct iovec **ret_pointer); |
1694 | int check_access); | ||
1695 | 1703 | ||
1696 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1704 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1697 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1705 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |