linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autofs4 sparse fixes
@ 2003-09-28 23:26 Andries.Brouwer
  0 siblings, 0 replies; only message in thread
From: Andries.Brouwer @ 2003-09-28 23:26 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

diff -u --recursive --new-file -X /linux/dontdiff a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
--- a/fs/autofs4/autofs_i.h	Mon Sep 29 01:05:41 2003
+++ b/fs/autofs4/autofs_i.h	Mon Sep 29 01:09:24 2003
@@ -132,9 +132,10 @@
 /* Expiration */
 int is_autofs4_dentry(struct dentry *);
 int autofs4_expire_run(struct super_block *, struct vfsmount *,
-			struct autofs_sb_info *, struct autofs_packet_expire *);
+		       struct autofs_sb_info *,
+		       struct autofs_packet_expire __user *);
 int autofs4_expire_multi(struct super_block *, struct vfsmount *,
-			struct autofs_sb_info *, int *);
+			struct autofs_sb_info *, int __user *);
 
 /* Operations structures */
 
diff -u --recursive --new-file -X /linux/dontdiff a/fs/autofs4/expire.c b/fs/autofs4/expire.c
--- a/fs/autofs4/expire.c	Mon Sep 29 01:05:41 2003
+++ b/fs/autofs4/expire.c	Mon Sep 29 01:09:24 2003
@@ -221,7 +221,7 @@
 int autofs4_expire_run(struct super_block *sb,
 		      struct vfsmount *mnt,
 		      struct autofs_sb_info *sbi,
-		      struct autofs_packet_expire *pkt_p)
+		      struct autofs_packet_expire __user *pkt_p)
 {
 	struct autofs_packet_expire pkt;
 	struct dentry *dentry;
@@ -248,7 +248,7 @@
 /* Call repeatedly until it returns -EAGAIN, meaning there's nothing
    more to be done */
 int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
-			struct autofs_sb_info *sbi, int *arg)
+			struct autofs_sb_info *sbi, int __user *arg)
 {
 	struct dentry *dentry;
 	int ret = -EAGAIN;
diff -u --recursive --new-file -X /linux/dontdiff a/fs/autofs4/root.c b/fs/autofs4/root.c
--- a/fs/autofs4/root.c	Mon Sep 29 01:05:41 2003
+++ b/fs/autofs4/root.c	Mon Sep 29 01:09:24 2003
@@ -542,12 +542,13 @@
 
 	/* return a single thing to expire */
 	case AUTOFS_IOC_EXPIRE:
-		return autofs4_expire_run(inode->i_sb,filp->f_vfsmnt,sbi,
-					  (struct autofs_packet_expire *)arg);
+		return autofs4_expire_run(inode->i_sb, filp->f_vfsmnt, sbi,
+				(struct autofs_packet_expire __user *) arg);
+
 	/* same as above, but can send multiple expires through pipe */
 	case AUTOFS_IOC_EXPIRE_MULTI:
-		return autofs4_expire_multi(inode->i_sb,filp->f_vfsmnt,sbi,
-					    (int *)arg);
+		return autofs4_expire_multi(inode->i_sb, filp->f_vfsmnt, sbi,
+					    (int __user *) arg);
 
 	default:
 		return -ENOSYS;
diff -u --recursive --new-file -X /linux/dontdiff a/fs/autofs4/symlink.c b/fs/autofs4/symlink.c
--- a/fs/autofs4/symlink.c	Mon Sep 29 01:05:41 2003
+++ b/fs/autofs4/symlink.c	Mon Sep 29 01:09:24 2003
@@ -12,7 +12,8 @@
 
 #include "autofs_i.h"
 
-static int autofs4_readlink(struct dentry *dentry, char *buffer, int buflen)
+static int
+autofs4_readlink(struct dentry *dentry, char __user *buffer, int buflen)
 {
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
 
diff -u --recursive --new-file -X /linux/dontdiff a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
--- a/fs/autofs4/waitq.c	Mon Sep 29 01:05:41 2003
+++ b/fs/autofs4/waitq.c	Mon Sep 29 01:09:24 2003
@@ -54,6 +54,7 @@
 	mm_segment_t fs;
 	const char *data = (const char *)addr;
 	ssize_t wr = 0;
+        ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
 
 	/** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
 
@@ -63,8 +64,12 @@
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 
+	/* Our write does not write to user space */
+	write = (ssize_t (*)(struct file *, const char *, size_t, loff_t *))
+		file->f_op->write;
+
 	while (bytes &&
-	       (wr = file->f_op->write(file,data,bytes,&file->f_pos)) > 0) {
+	       (wr = write(file,data,bytes,&file->f_pos)) > 0) {
 		data += wr;
 		bytes -= wr;
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-28 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 23:26 [PATCH] autofs4 sparse fixes Andries.Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).