-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fs/ntfs3: Fix memory corruption when page_size changes #6218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It'd be worth throwing that patch upstream for review. |
I’m affected by the issue with my over 35 external NTFS HDDs (my user there is Patrick_G): https://forums.raspberrypi.com/viewtopic.php?p=2218370#p2218370 I could test it with my Pi 5. Please let me know if there is a build I could install, as the user “dom” suggested. It seems like the current pull request is failing? Should I try running “sudo rpi-update pulls/6218”? |
Yes - the checkpatch failure is only advisory. |
So, this took me some time. I attempted the update three times this evening, and the first attempt failed completely. If your Raspberry Pi has already updated to 6.6 and some disk issues persist, it might be better to downgrade to 6.1. Here’s the method that worked to get the Pi running: BUT! However, one issue still persists. The disks mount very, very slowly with this 6.6 kernel. It takes over 2 minutes to mount my 30 USB HDD drives. With kernel 6.1, it was about 30 seconds. But it seems this updated kernel 6.6 doesn’t freeze anymore. I will now run the pi with this 6.6 kernel but something is still broken with mounting a lot of ntfs drives. Specially after a reboot. |
Update2: After a restart (crash or power loss idk) 3 HDDs are missing again. Seems this fix didnt help :( |
Post the dmesg output from the 6.6 boot with missing drives. |
@6by9 submited but no response so far: |
Two reports of this fixing the issue here |
Are the logs still available? or only a few hour days? |
dmesg logs are available until they are overwritten. But you can always reboot and capture a fresh log (I assume the failure is repeatable?)
No, and that's not going to be related to this issue. You should create a new one. |
The rework in fs/ntfs3: Reduce stack usage changes log->page_size but doesn't change the associated log->page_mask and log->page_bits. That results in the bytes value in read_log_page getting a negative value, which is bad when it is passed to memcpy. The kernel panic can be observed when connecting an ntfs formatted drive that has previously been connected to a Windows machine to a Raspberry Pi 5, which by defauilt uses a 16K kernel pagesize. Fixes: 865e7a7 ("fs/ntfs3: Reduce stack usage") Signed-off-by: Dom Cobley <[email protected]>
No response after a week from submission upstream. Suggest we just merge this as it has reports of fixing a clear error. |
See: raspberrypi/linux#6218 kernel: drm/bridge: panel: Ensure backlight is reachable See: raspberrypi/linux#6230
See: raspberrypi/linux#6218 kernel: drm/bridge: panel: Ensure backlight is reachable See: raspberrypi/linux#6230
Thanks for reporting this upstream. Maybe the maintainer is not comfortable with bug reports from a vendor tree plus a non-recent Kernel version (6.9.x or 6.10-rcX is more welcome). At least the regression is on the tracker list, so in case the maintainer doesn't react this would be escalated. |
I can confirm that bug is present in our rpi-6.10-y tree, and the fix still works. |
The rework in fs/ntfs3: Reduce stack usage
changes log->page_size but doesn't change the associated log->page_mask and log->page_bits.
That results in the bytes value in read_log_page
getting a negative value, which is bad when it is
passed to memcpy.
The kernel panic can be observed when connecting an ntfs formatted drive that has previously been connected to a Windows machine to a Raspberry Pi 5, which by defauilt uses a 16K kernel pagesize.
Fixes: 865e7a7 ("fs/ntfs3: Reduce stack usage")