From: David Disseldorp <ddiss@samba.org>
To: David Howells <dhowells@redhat.com>
Cc: Jeremy Allison <jra@samba.org>,
Paulo Alcantara <pc@manguebit.com>, Tom Talpey <tom@talpey.com>,
ronnie sahlberg <ronniesahlberg@gmail.com>,
David Howells via samba-technical
<samba-technical@lists.samba.org>,
Steve French <sfrench@samba.org>,
linux-cifs@vger.kernel.org
Subject: Re: Bug in Samba's implementation of FSCTL_QUERY_ALLOCATED_RANGES?
Date: Fri, 23 Aug 2024 13:20:52 +0000 [thread overview]
Message-ID: <20240823132052.3f591f2f.ddiss@samba.org> (raw)
In-Reply-To: <319947.1724365560@warthog.procyon.org.uk>
Thanks for the follow up ping...
On Thu, 22 Aug 2024 23:26:00 +0100, David Howells wrote:
> > if (out_output->length > in_max_output) {
> > DEBUG(2, ("QAR output len %lu exceeds max %lu\n",
> > (unsigned long)out_output->length,
> > (unsigned long)in_max_output));
> > data_blob_free(out_output);
> > return NT_STATUS_BUFFER_TOO_SMALL;
> > }
> >
> > I'm guessing in this case we need to just truncate out_output->length
> > to in_max_output and return STATUS_BUFFER_OVERFLOW.
>
> Do you perchance have a fix for this? I'm seeing it cause failures in
> xfstests when running against cifs connected to samba.
I've proposed a fix via
https://gitlab.com/samba-team/samba/-/merge_requests/3775
If you want to try it yourself...
The following changes since commit b0996ed589a931902a304237d6c03efce2b16f6b:
s3:tests: Fix spelling error (2024-08-22 10:38:09 +0000)
are available in the Git repository at:
https://gitlab.com/ddiss/samba.git qar_rsp_truncation
for you to fetch changes up to 3c034c4d177ea2367b3131f813381d91c98ab7e1:
s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation (2024-08-23 13:06:04 +0000)
----------------------------------------------------------------
David Disseldorp (2):
smb2_ioctl: truncate FSCTL_QUERY_ALLOCATED_RANGES responses
s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation
source3/smbd/smb2_ioctl.c | 4 +-
source3/smbd/smb2_ioctl_filesys.c | 54 ++++++++------
source4/libcli/smb2/ioctl.c | 3 +-
source4/torture/smb2/ioctl.c | 150 +++++++++++++++++++++++++++++++++++++-
4 files changed, 187 insertions(+), 24 deletions(-)
next prev parent reply other threads:[~2024-08-23 13:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 23:53 Bug in Samba's implementation of FSCTL_QUERY_ALLOCATED_RANGES? David Howells
2024-05-22 8:53 ` David Disseldorp
2024-05-22 10:36 ` David Howells
2024-05-23 4:54 ` David Disseldorp
2024-05-23 5:05 ` ronnie sahlberg
2024-05-23 6:21 ` David Howells
2024-05-23 6:28 ` ronnie sahlberg
2024-05-23 6:36 ` David Howells
2024-05-23 14:29 ` Tom Talpey
2024-05-23 15:28 ` Paulo Alcantara
2024-05-23 22:49 ` Jeremy Allison
2024-05-24 7:45 ` Stefan Metzmacher
2024-08-22 22:26 ` David Howells
2024-08-23 13:20 ` David Disseldorp [this message]
2024-08-28 10:25 ` David Howells
2024-08-28 10:55 ` David Disseldorp
2024-08-28 11:52 ` David Howells
2024-08-28 12:57 ` David Disseldorp
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=20240823132052.3f591f2f.ddiss@samba.org \
--to=ddiss@samba.org \
--cc=dhowells@redhat.com \
--cc=jra@samba.org \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--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