Fix: prevent lfs_mountroot() from using a network device as root. Important for net-booting of kernels which have LFS in their config, preventing a null-pointer dereference and a crash. Index: sys/ufs/lfs/lfs_vfsops.c =================================================================== RCS file: /cvsroot/syssrc/sys/ufs/lfs/lfs_vfsops.c,v retrieving revision 1.36 retrieving revision 1.38 diff -u -r1.36 -r1.38 --- lfs_vfsops.c 1999/09/03 22:48:51 1.36 +++ lfs_vfsops.c 1999/09/08 08:29:45 1.38 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.36 1999/09/03 22:48:51 perseant Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.38 1999/09/08 08:29:45 augustss Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -164,6 +165,11 @@ struct proc *p = curproc; /* XXX */ int error; + if (root_device->dv_class != DV_DISK) + return (ENODEV); + + if (rootdev == NODEV) + return (ENODEV); /* * Get vnodes for swapdev and rootdev. */