Hello everyone.  This not something major, but I recently experienced
panics in some of my old QNX4 filesystem porting code, and an old 5.0
kernel with UNIONFS problems.

The kernel will panic if vfs_get/copyopt() was passed 'opts' as NULL.
It would be good to add KASSERT's to these calls.  I have passed this
patch around on IRC, and have not seen any objections.

Can the right maintainer of sys/kern/vfs_mount.c commit/review the
patch attached with this mail.  Also available from:

        http://www.unixdaemons.com/~hiten/work/diffs/vfs_mount.c.patch

Cheers.

-- 
Hiten Pandya ([EMAIL PROTECTED], [EMAIL PROTECTED])
http://www.unixdaemons.com/~hiten/
Index: sys/kern/vfs_mount.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_mount.c,v
retrieving revision 1.97
diff -u -r1.97 vfs_mount.c
--- sys/kern/vfs_mount.c        21 Jan 2003 08:55:55 -0000      1.97
+++ sys/kern/vfs_mount.c        14 Feb 2003 09:40:18 -0000
@@ -1714,6 +1714,9 @@
 {
        struct vfsopt *opt;
 
+       KASSERT(opts != NULL,
+           ("vfs_getopt: caller passed 'opts' as NULL\n"));
+
        TAILQ_FOREACH(opt, opts, link) {
                if (strcmp(name, opt->name) == 0) {
                        if (len != NULL)
@@ -1742,6 +1745,9 @@
        int len;
 {
        struct vfsopt *opt;
+
+       KASSERT(opts != NULL,
+           ("vfs_copyopt: caller passed 'opts' as NULL\n"));
 
        TAILQ_FOREACH(opt, opts, link) {
                if (strcmp(name, opt->name) == 0) {

Reply via email to