Date: Tue, 19 Jul 2022 13:32:40 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 265311] silly mount() arguments with MNT_UPDATE and MNT_UNION can cause kernel page-fault Message-ID: <bug-265311-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265311 Bug ID: 265311 Summary: silly mount() arguments with MNT_UPDATE and MNT_UNION can cause kernel page-fault Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu This user program causes a kernel page fault in CURRENT: char data[128]; memset(data, 0, sizeof(data)); *(char **)data =3D "doesnotexist"; mount("ffs", "/", 0x10020, data); 0x10020 is MNT_UPDATE and MNT_UNION. The crash happens because the argument to VREF is zero in this code from vfs_lookup(): if ((error =3D=3D ENOENT) && (dp->v_vflag & VV_ROOT) && (dp->v_mount !=3D NULL) && (dp->v_mount->mnt_flag & MNT_UNION)) { tdp =3D dp; dp =3D dp->v_mount->mnt_vnodecovered; VREF(dp); panic: Fatal page fault at 0xffffffc0003934f4: 0x000000000001ac ... panic() at panic+0x2a page_fault_handler() at page_fault_handler+0x1a4 do_trap_supervisor() at do_trap_supervisor+0x76 cpu_exception_handler_supervisor() at cpu_exception_handler_supervisor+0x70 --- exception 13, tval =3D 0x1ac refcount_acquire_if_gt() at refcount_acquire_if_gt+0xe refcount_acquire_if_not_zero() at refcount_acquire_if_not_zero+0xc vget_prep() at vget_prep+0x14 vref() at vref+0x10 vfs_lookup() at vfs_lookup+0x374 namei() at namei+0x17e ffs_mount() at ffs_mount+0x2dc vfs_domount_update() at vfs_domount_update+0x1fa vfs_domount() at vfs_domount+0x230 vfs_donmount() at vfs_donmount+0x742 kernel_mount() at kernel_mount+0x4e ffs_cmount() at ffs_cmount+0x60 sys_mount() at sys_mount+0x17e syscallenter() at syscallenter+0xec ecall_handler() at ecall_handler+0x18 do_trap_user() at do_trap_user+0xea cpu_exception_handler_user() at cpu_exception_handler_user+0x72 --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-265311-227>