The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Hongling Zeng <zhongling0719@126.com>
To: Namjae Jeon <linkinjeon@kernel.org>,
	 Hongling Zeng <zenghongling@kylinos.cn>
Cc: hyc.lee@gmail.com, alexandro.calo@nozominetworks.com,
	 ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH v3] ntfs: validate non-resident attribute offsets
Date: Fri, 07 Aug 2026 09:55:47 +0800	[thread overview]
Message-ID: <6A753B23.3070908@126.com> (raw)
In-Reply-To: <CAKYAXd91TzMghrpOG4pBYr-9UBY9qJ6by=mrkS0m4BxMZEbrHg@mail.gmail.com>


在 2026年08月06日 21:17, Namjae Jeon 写道:
>> +       /* Ensure there's room for the compressed_size field if needed. */
>> +       if (!(a->flags & ATTR_IS_SPARSE) &&
>> +           !(a->flags & ATTR_IS_COMPRESSED) &&
>> +           attr_len - mp_offset < sizeof(a->data.non_resident.compressed_size))
>> +               return false;
> Sorry for the confusion. I rechecked the code and realized that
> ATTR_COMPRESSION_MASK is correct here. It covers the entire
> compression field, while ATTR_IS_COMPRESSED checks only the 0x0001
> bit. Since this validation checks whether the attribute layout
> includes compressed_size, it should use the mask, consistent with the
> existing min_len check.  So I have applied the previously attached
> patch.
>
> Thanks!
You're absolutely correct, Thanks for the guidance and applied the 
patch . I now understand that ATTR_COMPRESSION_MASK
   (0x00ff) is the correct choice—it covers all compression cases, not 
just  the 0x0001 flag.


      reply	other threads:[~2026-08-07  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  5:57 [PATCH v3] ntfs: validate non-resident attribute offsets Hongling Zeng
2026-08-06 13:17 ` Namjae Jeon
2026-08-07  1:55   ` Hongling Zeng [this message]

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=6A753B23.3070908@126.com \
    --to=zhongling0719@126.com \
    --cc=alexandro.calo@nozominetworks.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=zenghongling@kylinos.cn \
    /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