Commit a63df8c1 authored by Linus Torvalds's avatar Linus Torvalds

Fix user pointer annotations in more places, now that 'sparse'

verifies declarations against definitions and checks argument
types.
parent eece3947
...@@ -335,7 +335,7 @@ static ssize_t do_readv_writev(int type, struct file *file, ...@@ -335,7 +335,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
const struct iovec __user * uvector, const struct iovec __user * uvector,
unsigned long nr_segs, loff_t *pos) unsigned long nr_segs, loff_t *pos)
{ {
typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *); typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *); typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *);
size_t tot_len; size_t tot_len;
...@@ -423,7 +423,7 @@ static ssize_t do_readv_writev(int type, struct file *file, ...@@ -423,7 +423,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
ret = 0; ret = 0;
vector = iov; vector = iov;
while (nr_segs > 0) { while (nr_segs > 0) {
void * base; void __user * base;
size_t len; size_t len;
ssize_t nr; ssize_t nr;
......
...@@ -752,11 +752,11 @@ struct inode_operations { ...@@ -752,11 +752,11 @@ struct inode_operations {
struct seq_file; struct seq_file;
extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *); extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *); extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t vfs_readv(struct file *, const struct iovec *, extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
unsigned long, loff_t *); unsigned long, loff_t *);
extern ssize_t vfs_writev(struct file *, const struct iovec *, extern ssize_t vfs_writev(struct file *, const struct iovec __user *,
unsigned long, loff_t *); unsigned long, loff_t *);
/* /*
...@@ -1202,16 +1202,16 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); ...@@ -1202,16 +1202,16 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
int generic_write_checks(struct inode *inode, struct file *file, int generic_write_checks(struct inode *inode, struct file *file,
loff_t *pos, size_t *count, int isblk); loff_t *pos, size_t *count, int isblk);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t generic_file_aio_read(struct kiocb *, char *, size_t, loff_t); extern ssize_t generic_file_aio_read(struct kiocb *, char *, size_t, loff_t);
extern ssize_t generic_file_aio_write(struct kiocb *, const char *, size_t, loff_t); extern ssize_t generic_file_aio_write(struct kiocb *, const char *, size_t, loff_t);
extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
unsigned long, loff_t *); unsigned long, loff_t *);
extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
unsigned long nr_segs, loff_t *ppos); unsigned long nr_segs, loff_t *ppos);
extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
...@@ -1247,9 +1247,9 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, ...@@ -1247,9 +1247,9 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
extern struct file_operations generic_ro_fops; extern struct file_operations generic_ro_fops;
extern int vfs_readlink(struct dentry *, char *, int, const char *); extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
extern int vfs_follow_link(struct nameidata *, const char *); extern int vfs_follow_link(struct nameidata *, const char *);
extern int page_readlink(struct dentry *, char *, int); extern int page_readlink(struct dentry *, char __user *, int);
extern int page_follow_link(struct dentry *, struct nameidata *); extern int page_follow_link(struct dentry *, struct nameidata *);
extern int page_symlink(struct inode *inode, const char *symname, int len); extern int page_symlink(struct inode *inode, const char *symname, int len);
extern struct inode_operations page_symlink_inode_operations; extern struct inode_operations page_symlink_inode_operations;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
struct iovec struct iovec
{ {
void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
__kernel_size_t iov_len; /* Must be size_t (1003.1g) */ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment