History

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.

Christopher Yeoh committed 14 years ago

Commit ac34ebb1 parent ee62c6b8 files · +29 −23Browse files

Showing the changes to include (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/compat.h +1 −2
  2. include/linux/fs.h +10 −2
include/linux/compat.h+1−2
@@ -577,8 +577,7 @@ extern ssize_t compat_rw_copy_check_uvector(int type, · 576 unmodified lines
577577 const struct compat_iovec __user *uvector,
578578 unsigned long nr_segs,
579579 unsigned long fast_segs, struct iovec *fast_pointer,
580− struct iovec **ret_pointer,
581− int check_access);
580+ struct iovec **ret_pointer);
582581
583582 extern void __user *compat_alloc_user_space(unsigned long len);
584583
include/linux/fs.h+10−2
@@ -173,6 +173,15 @@ struct inodes_stat_t { · 172 unmodified lines
173173 #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
174174 #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
175175
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+
176185 #define SEL_IN 1
177186 #define SEL_OUT 2
178187 #define SEL_EX 4
@@ -1690,8 +1699,7 @@ struct seq_file; · 1511 unmodified lines
16901699 ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
16911700 unsigned long nr_segs, unsigned long fast_segs,
16921701 struct iovec *fast_pointer,
1693− struct iovec **ret_pointer,
1694− int check_access);
1702+ struct iovec **ret_pointer);
16951703
16961704 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
16971705 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t