Date: Tue, 12 Oct 2021 19:00:59 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 259112] A damaged ext3 inode with bad extents can cause a kernel page fault. Message-ID: <bug-259112-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259112 Bug ID: 259112 Summary: A damaged ext3 inode with bad extents can cause a kernel page fault. Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Created attachment 228634 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228634&action= =3Dedit A damaged ext3 file system that causes a kernel page fault. If a damaged ext3 inode claims to have extents with depth greater than 5, ext4_ext_find_extent() &c can run off the end of the paths array. ext4_ext_check_header() should probably check eh_depth. I've attached a demo: # uname -a FreeBSD stock14 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n248636-d20e9e02d= b3: Thu Aug 12 05:47:18 UTC 2021=20=20=20=20 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 # gunzip ext310.img.gz=20 # mdconfig -f ext310.img # mount -t ext2fs -o ro /dev/md0 /mnt # cp /mnt/a /dev/null Fatal trap 12: page fault while in kernel mode cpuid =3D 0; apic id =3D 00 fault virtual address =3D 0xffff80403fffc000 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff810c2d23 stack pointer =3D 0x28:0xfffffe009bba7350 frame pointer =3D 0x28:0xfffffe009bba7350 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 871 (cp) trap number =3D 12 panic: page fault cpuid =3D 0 time =3D 1634064958 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe009bba6= ff0 vpanic() at vpanic+0x187/frame 0xfffffe009bba7050 panic() at panic+0x43/frame 0xfffffe009bba70b0 trap_fatal() at trap_fatal+0x387/frame 0xfffffe009bba7110 trap_pfault() at trap_pfault+0x99/frame 0xfffffe009bba7170 trap() at trap+0x2a7/frame 0xfffffe009bba7280 calltrap() at calltrap+0x8/frame 0xfffffe009bba7280 --- trap 0xc, rip =3D 0xffffffff810c2d23, rsp =3D 0xfffffe009bba7350, rbp = =3D 0xfffffe009bba7350 --- pmap_kextract() at pmap_kextract+0x1d3/frame 0xfffffe009bba7350 free() at free+0x52/frame 0xfffffe009bba7380 ext4_ext_find_extent() at ext4_ext_find_extent+0x45f/frame 0xfffffe009bba74= 00 ext4_bmapext() at ext4_bmapext+0x97/frame 0xfffffe009bba7460 ext2_strategy() at ext2_strategy+0x5b/frame 0xfffffe009bba7490 bufstrategy() at bufstrategy+0x3e/frame 0xfffffe009bba74c0 breadn_flags() at breadn_flags+0x1a3/frame 0xfffffe009bba7530 ext2_blkatoff() at ext2_blkatoff+0x56/frame 0xfffffe009bba75b0 ext2_lookup_ino() at ext2_lookup_ino+0x2af/frame 0xfffffe009bba76c0 vfs_cache_lookup() at vfs_cache_lookup+0xa6/frame 0xfffffe009bba7710 lookup() at lookup+0x4a1/frame 0xfffffe009bba77b0 namei() at namei+0x358/frame 0xfffffe009bba7870 kern_statat() at kern_statat+0x12d/frame 0xfffffe009bba79c0 sys_fstatat() at sys_fstatat+0x2f/frame 0xfffffe009bba7ac0 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe009bba7bf0 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe009bba7bf0 --=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-259112-227>