Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Limit the superblock size to SBLOCKSIZE, not MAX...



details:   https://anonhg.NetBSD.org/src/rev/7a54a4f4ce60
branches:  trunk
changeset: 333367:7a54a4f4ce60
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Oct 30 17:13:41 2014 +0000

description:
Limit the superblock size to SBLOCKSIZE, not MAXBSIZE. Otherwise memcpy
will read beyond the allocated buffer.

Discussed a bit on tech-kern@.

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 3e0398d6097c -r 7a54a4f4ce60 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Thu Oct 30 16:45:28 2014 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Thu Oct 30 17:13:41 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.300 2014/10/24 13:18:51 njoly Exp $   */
+/*     $NetBSD: ffs_vfsops.c,v 1.301 2014/10/30 17:13:41 maxv Exp $    */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.300 2014/10/24 13:18:51 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.301 2014/10/30 17:13:41 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -974,7 +974,7 @@
                        continue;
 
                /* Validate size of superblock */
-               if (sbsize > MAXBSIZE || sbsize < sizeof(struct fs))
+               if (sbsize > SBLOCKSIZE || sbsize < sizeof(struct fs))
                        continue;
 
                /* Check that we can handle the file system blocksize */



Home | Main Index | Thread Index | Old Index