Module Name: src
Committed By: tsutsui
Date: Sat Jun 30 11:01:42 UTC 2012
Modified Files:
src/sys/fs/msdosfs: msdosfs_vfsops.c
Log Message:
Add a sanity check if secsize returned from getdisksize() isn't bogus.
This prevent possible panic "panic: buf mem pool index 23" later in
vfs_bio.c:buf_mempoolidx().
(I'm not sure if it's okay for getdisksize() to assume that
partinfo taken from DIOCGPART is properly initialized
on all disk(9) devices or not)
See also:
http://mail-index.NetBSD.org/source-changes/2012/06/30/msg035298.html
To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/fs/msdosfs/msdosfs_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/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.94 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.95
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.94 Tue Mar 13 18:40:37 2012
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c Sat Jun 30 11:01:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.94 2012/03/13 18:40:37 elad Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.95 2012/06/30 11:01:41 tsutsui Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.94 2012/03/13 18:40:37 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.95 2012/06/30 11:01:41 tsutsui Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -493,7 +493,7 @@ msdosfs_mountfs(struct vnode *devvp, str
goto error_exit;
error = getdisksize(devvp, &psize, &secsize);
- if (error) {
+ if (error || secsize == 0) {
if (argp->flags & MSDOSFSMNT_GEMDOSFS)
goto error_exit;