Module Name: src Committed By: martin Date: Mon Dec 29 16:28:14 UTC 2014
Modified Files: src/sys/ufs/ffs [netbsd-7]: ffs_vfsops.c Log Message: Pull up following revision(s) (requested by maxv in ticket #352): sys/ufs/ffs/ffs_vfsops.c: revision 1.301 Limit the superblock size to SBLOCKSIZE, not MAXBSIZE. Otherwise memcpy will read beyond the allocated buffer. Discussed a bit on tech-kern@. To generate a diff of this commit: cvs rdiff -u -r1.299.2.1 -r1.299.2.2 src/sys/ufs/ffs/ffs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/ffs/ffs_vfsops.c diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.299.2.1 src/sys/ufs/ffs/ffs_vfsops.c:1.299.2.2 --- src/sys/ufs/ffs/ffs_vfsops.c:1.299.2.1 Tue Nov 18 18:40:06 2014 +++ src/sys/ufs/ffs/ffs_vfsops.c Mon Dec 29 16:28:14 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.299.2.1 2014/11/18 18:40:06 snj Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.299.2.2 2014/12/29 16:28:14 martin 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.299.2.1 2014/11/18 18:40:06 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.299.2.2 2014/12/29 16:28:14 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -974,7 +974,7 @@ ffs_mountfs(struct vnode *devvp, struct 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 */