From: Paulo Alcantara <pc@manguebit.org>
To: Abdifatah Suruur <suruurism@gmail.com>, linux-cifs@vger.kernel.org
Cc: Namjae Jeon <linkinjeon@kernel.org>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
samba-technical@lists.samba.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] smb: client: fix fiemap wild read on empty truncated response
Date: Fri, 23 Oct 2026 17:24:15 -0300 [thread overview]
Message-ID: <c416b30156fc537af171146be013dd28@manguebit.org> (raw)
In-Reply-To: <20261023115246.23030-1-suruurism@gmail.com>
Abdifatah Suruur <suruurism@gmail.com> writes:
> smb3_fiemap() treats -E2BIG from SMB2_ioctl() as a truncated range blob
> and loops for the next chunk. If the server reports
> STATUS_BUFFER_OVERFLOW with OutputCount == 0, SMB2_ioctl() returns
> -E2BIG with out_data == NULL and out_data_len == 0, and the existing
> length checks accept the empty result. The loop then evaluates
>
> next = out_data[num - 1].file_offset + ...
>
> with num == 0, reading 16 bytes before NULL.
>
> Reject a truncated range blob that contains no range, so the resume
> offset is never computed from an empty response. Also require the last
> range in a truncated blob to advance the resume offset without
> overflowing, and to stay within the requested range; a malicious or
> broken server could otherwise make no progress or underflow len and loop
> forever. Free the previous response buffer before retrying.
> ...
Applied.
prev parent reply other threads:[~2026-10-23 20:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 11:52 Abdifatah Suruur
2026-10-23 20:24 ` Paulo Alcantara [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=c416b30156fc537af171146be013dd28@manguebit.org \
--to=pc@manguebit.org \
--cc=bharathsm@microsoft.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=sprasad@microsoft.com \
--cc=suruurism@gmail.com \
--cc=tom@talpey.com \
/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
all inboxes | Powered by JetHome®