Opened 6 years ago

Closed 6 years ago

#14248 closed bug (fixed)

KDL: SMAP violation (NTFS + git)

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

Description

I attempted to "git pull" from a read-only NTFS partition and it resulted in a SMAP KDL. Sorry the KDL message is cut off here...

After disabling SMAP, I still couldn't pull (git errors with "mmap failed: invalid argument.") I didn't spend a lot of time trying to diagnose that one.

Attachments (1)

ntfs_smap_kdl.jpg (429.3 KB ) - added by waddlesplash 6 years ago.

Download all attachments as: .zip

Change History (5)

by waddlesplash, 6 years ago

Attachment: ntfs_smap_kdl.jpg added

comment:1 by korli, 6 years ago

I reproduced locally, but it seems non obvious to fix: the memcpy happens in libntfs. It might be better to use a temporary kernel buffer and avoid modifying the library. I checked the code at https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/file_systems/ntfs/fs_func.c#L1231 and it seems already broken, trying to loop on the same output buffer. The loop is probably not needed for a kernel output buffer. BTW the same KDL happens on write.

comment:2 by waddlesplash, 6 years ago

If libntfs just uses memcpy, and I think it's also used in kernel mode elsewhere, that implies it never is passed anything but kernel buffers. Perhaps we should fix this KDL in the VFS layer instead of individual drivers?

comment:3 by korli, 6 years ago

No, the drivers which already use the file cache aren't affected. But yes, I suppose a few other file systems need to be adjusted.

comment:4 by korli, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev52082 and hrev52083.

Note: See TracTickets for help on using tickets.