From owner-freebsd-current Fri Feb 14 2:34: 3 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CB7837B401 for ; Fri, 14 Feb 2003 02:34:01 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 671FF43F93 for ; Fri, 14 Feb 2003 02:34:00 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.7/8.12.1) with ESMTP id h1EAXxeG076559 for ; Fri, 14 Feb 2003 05:33:59 -0500 (EST) Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.7/8.12.1/Submit) id h1EAXx2n076554 for current@FreeBSD.ORG; Fri, 14 Feb 2003 05:33:59 -0500 (EST) (envelope-from hiten) Date: Fri, 14 Feb 2003 05:33:59 -0500 From: Hiten Pandya To: current@FreeBSD.ORG Subject: KASSERT's for vfs_{get,copy}opt() Message-ID: <20030214103359.GA73639@unixdaemons.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vfs_mount.c.patch" 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) { --3MwIy2ne0vdjdPXF-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message