From: Eric Sandeen <sandeen@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Eric Sandeen <esandeen@redhat.com>,
Eric Sandeen <sandeen@redhat.com>
Subject: [PATCH 1/4] blkid: probe_ntfs: fix attr->len endian swap size
Date: Thu, 24 Sep 2026 16:02:45 -0500 [thread overview]
Message-ID: <20260924210421.3631790-2-sandeen@redhat.com> (raw)
In-Reply-To: <20260924210421.3631790-1-sandeen@redhat.com>
From: Eric Sandeen <esandeen@redhat.com>
attr->len is a __u32, so use blkid_le32(), and change attr_len (to which
it is assigned) to an unsigned int as well.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
lib/blkid/probe.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index 6a3bb247..31d048db 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -689,8 +689,8 @@ static int probe_ntfs(struct blkid_probe *probe,
struct file_attribute *attr;
char uuid_str[17], label_str[129], *cp;
int bytes_per_sector, sectors_per_cluster;
- int mft_record_size, attr_off, attr_len;
- unsigned int i, attr_type, val_len;
+ int mft_record_size, attr_off;
+ unsigned int i, attr_len, attr_type, val_len;
int val_off;
__u64 nr_clusters;
blkid_loff_t off;
@@ -752,7 +752,7 @@ static int probe_ntfs(struct blkid_probe *probe,
while (1) {
attr = (struct file_attribute *) (buf_mft + attr_off);
- attr_len = blkid_le16(attr->len);
+ attr_len = blkid_le32(attr->len);
attr_type = blkid_le32(attr->type);
val_off = blkid_le16(attr->value_offset);
val_len = blkid_le32(attr->value_len);
--
2.55.0
next prev parent reply other threads:[~2026-09-24 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 21:02 [PATCH 0/4] e2fsprogs: blkid: misc fixes Eric Sandeen
2026-09-24 21:02 ` Eric Sandeen [this message]
2026-09-24 21:02 ` [PATCH 2/4] blkid: probe_ntfs: validate on-disk attribute size/length Eric Sandeen
2026-09-24 21:02 ` [PATCH 3/4] blkid: probe_ntfs: validate offset and length of volume name Eric Sandeen
2026-09-24 21:02 ` [PATCH 4/4] blkid: probe_exfat: clamp untrusted label->length to valid size Eric Sandeen
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=20260924210421.3631790-2-sandeen@redhat.com \
--to=sandeen@redhat.com \
--cc=esandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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