Opened 2 years ago

Closed 2 years ago

#18021 closed bug (fixed)

Running find in NTFS directory panics in fs_read_dir() at reclen <= bufferRemaining

Reported by: nyanpasu64 Owned by: waddlesplash
Priority: normal Milestone: R1/beta4
Component: File Systems/NTFS Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Tried booting haiku-master-hrev56554-x86_64-anyboot.iso, mounting my Windows 7 disk (which passes Windows 7 chkdsk), then opening a shell, cd /WINDOWS followed by find. After around 10 seconds it reliably crashes at:

PANIC: ASSERT FAILED (...fs_ops_support.h:21): reclen <= bufferRemaining

This corresponds to https://github.com/haiku/haiku/blob/b2c77ad27a867a71e20fcde975bc5d06cd22e968/headers/private/file_systems/fs_ops_support.h#L21.

This function was inlined into ntfs's fs_read_dir: https://github.com/haiku/haiku/blob/3c1cf7b29467994b4719767eacc75fecf1caf12f/src/add-ons/kernel/file_systems/ntfs/kernel_interface.cpp#L1238

I'm guessing there's a logic error of some sort in this function, possibly linked to long folders. I don't know how to use KDL though, to debug what folder was being read, and I don't currently know what on-disk and in-memory types and values are present, the intended invariants, and what incorrect assumption led to this crash.

Attachments (1)

IMG_20221026_233055.jpg (2.3 MB ) - added by nyanpasu64 2 years ago.
Photo of KDL opened to the NTFS crash

Change History (5)

by nyanpasu64, 2 years ago

Attachment: IMG_20221026_233055.jpg added

Photo of KDL opened to the NTFS crash

comment:1 by diver, 2 years ago

Component: - GeneralFile Systems/NTFS
Owner: changed from nobody to waddlesplash
Version: R1/beta3R1/Development

comment:2 by waddlesplash, 2 years ago

Please see if hrev56557 fixes the problem.

comment:3 by nyanpasu64, 2 years ago

Tried haiku-master-hrev56560-x86_64-anyboot.iso (there was no hrev56557 .iso) and I no longer get a crash when running find in my Windows install. I haven't noticed any other funny behavior, though I did not test NTFS or the rest of Haiku deeply.

comment:4 by waddlesplash, 2 years ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed

Thanks for testing!

Note: See TracTickets for help on using tickets.