Linux filesystem development
 help / color / mirror / Atom feed
* red zone violation in ntfs_runlists_merge()
@ 2026-08-16 19:06 rtm
  2026-08-19  7:28 ` Hyunchul Lee
  0 siblings, 1 reply; 2+ messages in thread
From: rtm @ 2026-08-16 19:06 UTC (permalink / raw)
  To: Namjae Jeon, Hyunchul Lee; +Cc: linux-fsdevel

The following mounts a corrupt NTFS image that produces a red zone
violation:

# uname -a
Linux xxx 7.2.0-rc7-00016-g3d6d817622b0 #40 SMP PREEMPT_DYNAMIC Wed Aug 12 13:01:40 EDT 2026 x86_64 x86_64 x86_64 GNU/Linux
# wget http://www.rtmrtm.org/rtm/ntfs2b.img.gz
# gunzip ntfs2b.img.gz
mount -t ntfs -o loop ntfs2b.img /mnt
[Right Redzone overwritten] 0xffff888100321300-0xffff888100321307 @offset=4864. 
...

The overrun occurs in the last three lines of this code in
ntfs_runlists_merge():

                        drl[ds].length = marker_vcn - drl[ds].vcn;
                        /* Finally add the ENOENT terminator. */
                        ds++;
                        if (!slots) {
                                drl = ntfs_rl_realloc_nofail(drl, ds, ds + 1);
                                rtm_check(drl);
                                *new_rl_count += 1;
                        }
                        drl[ds].vcn = marker_vcn;
                        drl[ds].lcn = LCN_ENOENT;
                        drl[ds].length = (s64)0;

After the ds++, ds is too large, but slots == 1.

Robert Morris
rtm@mit.edu


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: red zone violation in ntfs_runlists_merge()
  2026-08-16 19:06 red zone violation in ntfs_runlists_merge() rtm
@ 2026-08-19  7:28 ` Hyunchul Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Hyunchul Lee @ 2026-08-19  7:28 UTC (permalink / raw)
  To: rtm; +Cc: Namjae Jeon, linux-fsdevel

Hi Robert,

I have submitted a patch for this issue:

https://lore.kernel.org/all/20260819-fix-empty-mp-v1-1-fb60b2eeca51@gmail.com/

2026년 8월 17일 (월) 오전 4:06, <rtm@csail.mit.edu>님이 작성:
>
> The following mounts a corrupt NTFS image that produces a red zone
> violation:
>
> # uname -a
> Linux xxx 7.2.0-rc7-00016-g3d6d817622b0 #40 SMP PREEMPT_DYNAMIC Wed Aug 12 13:01:40 EDT 2026 x86_64 x86_64 x86_64 GNU/Linux
> # wget http://www.rtmrtm.org/rtm/ntfs2b.img.gz
> # gunzip ntfs2b.img.gz
> mount -t ntfs -o loop ntfs2b.img /mnt
> [Right Redzone overwritten] 0xffff888100321300-0xffff888100321307 @offset=4864.
> ...
>
> The overrun occurs in the last three lines of this code in
> ntfs_runlists_merge():
>
>                         drl[ds].length = marker_vcn - drl[ds].vcn;
>                         /* Finally add the ENOENT terminator. */
>                         ds++;
>                         if (!slots) {
>                                 drl = ntfs_rl_realloc_nofail(drl, ds, ds + 1);
>                                 rtm_check(drl);
>                                 *new_rl_count += 1;
>                         }
>                         drl[ds].vcn = marker_vcn;
>                         drl[ds].lcn = LCN_ENOENT;
>                         drl[ds].length = (s64)0;
>
> After the ds++, ds is too large, but slots == 1.
>
> Robert Morris
> rtm@mit.edu
>


-- 
Thanks,
Hyunchul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-19  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16 19:06 red zone violation in ntfs_runlists_merge() rtm
2026-08-19  7:28 ` Hyunchul Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox