+ affs_fill_super-%s-abuses.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     affs_fill_super() %s abuses

has been added to the -mm tree.  Its filename is

     affs_fill_super-%s-abuses.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: affs_fill_super() %s abuses
From: Al Viro <viro@xxxxxxxxxxxxxxxx>


%s is valid only on NUL-terminated arrays, damnit!

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/affs/super.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff -puN fs/affs/super.c~affs_fill_super-%s-abuses fs/affs/super.c
--- a/fs/affs/super.c~affs_fill_super-%s-abuses
+++ a/fs/affs/super.c
@@ -271,6 +271,7 @@ static int affs_fill_super(struct super_
 	int			 reserved;
 	unsigned long		 mount_flags;
 	int			 tmp_flags;	/* fix remount prototype... */
+	u8			 sig[4];
 
 	pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
 
@@ -370,8 +371,9 @@ got_root:
 		printk(KERN_ERR "AFFS: Cannot read boot block\n");
 		goto out_error;
 	}
-	chksum = be32_to_cpu(*(__be32 *)boot_bh->b_data);
+	memcpy(sig, boot_bh->b_data, 4);
 	brelse(boot_bh);
+	chksum = be32_to_cpu(*(__be32 *)sig);
 
 	/* Dircache filesystems are compatible with non-dircache ones
 	 * when reading. As long as they aren't supported, writing is
@@ -420,11 +422,17 @@ got_root:
 	}
 
 	if (mount_flags & SF_VERBOSE) {
-		chksum = cpu_to_be32(chksum);
-		printk(KERN_NOTICE "AFFS: Mounting volume \"%*s\": Type=%.3s\\%c, Blocksize=%d\n",
-			AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0],
-			AFFS_ROOT_TAIL(sb, root_bh)->disk_name + 1,
-			(char *)&chksum,((char *)&chksum)[3] + '0',blocksize);
+		int len = AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0];
+		char name[32];
+
+		if (len > 31)
+			len = 31;
+		memcpy(name, AFFS_ROOT_TAIL(sb, root_bh)->disk_name + 1, len);
+		name[len] = '\0';
+
+		printk(KERN_NOTICE "AFFS: Mounting volume \"%*s\": "
+			"Type=%c%c%c\\%c, Blocksize=%d\n",
+			len, name, sig[0], sig[1], sig[2], sig[3], blocksize);
 	}
 
 	sb->s_flags |= MS_NODEV | MS_NOSUID;
_

Patches currently in -mm which might be from viro@xxxxxxxxxxxxxxxx are

sctp_unpack_cookie-fix.patch
inotify-add-names-inode-to-event-handler.patch
inotify-add-interfaces-to-kernel-api.patch
inotify-allow-watch-removal-from-event-handler.patch
inotify-update-kernel-documentation.patch
affs_fill_super-%s-abuses.patch
slab-leaks3-default-y.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux