NTFS3 file system kernel mode driver
 help / color / mirror / Atom feed
From: rtm@csail.mit.edu
To: almaz.alexandrovich@paragon-software.com
Cc: ntfs3@lists.linux.dev
Subject: a huge ntfs log file can cause log_read_rst() to loop forever
Date: Mon, 29 Jan 2024 13:21:49 -0500	[thread overview]
Message-ID: <77633.1706552509@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

I've attached an ntfs image that causes log_read_rst() to loop forever.

If the ntfs log file has a length near 2^32, then this for-loop in log_read_rst():

        u32 skip, vbo;

        if (first) {
                vbo = 0;
                skip = 512;
        } else {
                vbo = 512;
                skip = 0;
        }

        for (; vbo < l_size; vbo = 2 * vbo + skip, skip = 0) {

will cause vbo to wrap around to zero, at which point (since skip will
also be zero) the loop won't terminate.

# uname -a
Linux ubuntu66 6.7.0-11091-g296455ade1fd #5 SMP PREEMPT_DYNAMIC Fri Jan 19 15:38:07 EST 2024 x86_64 x86_64 x86_64 GNU/Linux
# gunzip -c < ntfs39a.img.gz > ntfs39a.img
# mount -t ntfs3 -o loop,rw junk /mnt
... never returns

Robert Morris
rtm@csail.mit.edu


[-- Attachment #2: ntfs39a.img.gz --]
[-- Type: application/octet-stream, Size: 124399 bytes --]

                 reply	other threads:[~2024-01-29 18:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77633.1706552509@localhost \
    --to=rtm@csail.mit.edu \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).