From owner-freebsd-bugs@freebsd.org Thu Mar 2 23:10:51 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9855CF50E5 for ; Thu, 2 Mar 2017 23:10:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6761D16 for ; Thu, 2 Mar 2017 23:10:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v22NApxT038977 for ; Thu, 2 Mar 2017 23:10:51 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 217508] admins calling nfssvc() can cause a NULL dereference and a panic while exporting a filesystem Date: Thu, 02 Mar 2017 23:10:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: tim.newsham@nccgroup.trust X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 23:10:51 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217508 Bug ID: 217508 Summary: admins calling nfssvc() can cause a NULL dereference and a panic while exporting a filesystem Product: Base System Version: 10.3-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: tim.newsham@nccgroup.trust /* * expcrash.c * Crash FreeBSD with an NFS export request. Description: When making a mount request with the nfssvc system call, the mount point may not be fully initialized, resulting in a NULL pointer and a crash. This can occur, for example, when making a NFSSVC_V4ROOTEXPORT call with the MNT_EXPORTED and MNT_EXPUBLIC flags. This dispatches to sys_nfsvc which calls nfssvc_nfsd to nfssvc_srvcall and to nfsrv_v4rootexport with the export arguments=20 provided by the caller. This calls to nfsrv_v4rootexport which uses the nfsv4root_mnt mount while calling to vfs_export and=20 vfs_setpublicfs. This mount record is not fully populated and when vfs_setpublicfs uses the VFS_ROOT macro which uses the VFS_PROLOGUE macro with the mount record, it deferences mp->mnt_vfc->vfc_flags. however, mnt_vfc has not yet been initialized and results in a NULL pointer dereference and a panic. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { struct nfsex_args args; int x; memset(&args, 0, sizeof args); args.export.ex_flags =3D MNT_EXPORTED | MNT_EXPUBLIC; x =3D nfssvc(NFSSVC_V4ROOTEXPORT, &args); printf("nfssvc %d\n", x); return 0; } --=20 You are receiving this mail because: You are the assignee for the bug.=