mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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] smb: client: validate the data area in SMB2_read()
Date: Thu, 22 Oct 2026 20:39:30 -0300	[thread overview]
Message-ID: <95d900581112fc82d188478be73cc83c@manguebit.org> (raw)
In-Reply-To: <20261022035329.17871-1-suruurism@gmail.com>

Abdifatah Suruur <suruurism@gmail.com> writes:

> SMB2_read() copies le32_to_cpu(rsp->DataLength) bytes from
> (char *)rsp + rsp->DataOffset without checking that the range lies
> within the response actually received. A READ response with
> DataOffset == 0 makes smb2_get_data_area_len() zero the data length, so
> smb2_check_message() accepts a frame as short as the fixed response,
> while SMB2_read() still uses the server-supplied DataLength, capped only
> by CIFS_MAX_MSGSIZE and the caller's length.
>
> A malicious server can answer the synchronous read used by the
> mfsymlinks (or SFU) symlink parser with an 81-byte READ response
> carrying DataOffset 0 and DataLength 1067, making the client copy 1067
> bytes from a 448-byte receive object (KASAN slab-out-of-bounds; up to
> 16 KiB in the general case).
>
> Clamp a zero (or header-overlapping) DataOffset to read_rsp_size, as
> handle_read_data() does for the asynchronous path, and reject the
> response unless DataOffset + DataLength fits within rsp_iov.iov_len.
> The SMB1 helper was fixed the same way in 5be5bdda5863.
> ...

Applied.

      reply	other threads:[~2026-10-22 23:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  3:53 Abdifatah Suruur
2026-10-22 23:39 ` 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=95d900581112fc82d188478be73cc83c@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®