public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: YunJe Shin <yjshin0438@gmail.com>
Cc: jgg@ziepe.ca, ioerts@kookmin.ac.kr, joonkyoj@yonsei.ac.kr,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/umad: Reject negative data_len in ib_umad_write
Date: Tue, 3 Feb 2026 11:46:29 +0200	[thread overview]
Message-ID: <20260203094629.GQ34749@unreal> (raw)
In-Reply-To: <20260203064620.686140-1-ioerts@kookmin.ac.kr>

On Tue, Feb 03, 2026 at 03:46:08PM +0900, YunJe Shin wrote:
> ib_umad_write computes data_len from user-controlled count and the
> MAD header sizes. With a mismatched user MAD header size and RMPP
> header length, data_len can become negative and reach ib_create_send_mad().
> This can make the padding calculation exceed the segment size and trigger
> an out-of-bounds memset in alloc_send_rmpp_list().
> 
> Add an explicit check to reject negative data_len before creating the
> send buffer.
> 
> KASAN splat:
> [  211.363464] BUG: KASAN: slab-out-of-bounds in ib_create_send_mad+0xa01/0x11b0
> [  211.364077] Write of size 220 at addr ffff88800c3fa1f8 by task spray_thread/102
> [  211.365867] ib_create_send_mad+0xa01/0x11b0
> [  211.365887] ib_umad_write+0x853/0x1c80
> 
> Fixes: 2be8e3ee8efd ("IB/umad: Add P_Key index support")
> Signed-off-by: YunJe Shin <ioerts@kookmin.ac.kr>
> ---
>  drivers/infiniband/core/user_mad.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Please submit this patch as a separate email, not as a reply.

Include a version number in the commit subject, and provide a changelog
below the Signed-off-by tag and the "---" marker.

Thanks

      reply	other threads:[~2026-02-03  9:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 11:00 [Bug] KASAN: null-ptr-deref in range in ib-comp-unb-wq ib_cq_poll_work yunje shin
2026-01-31 14:09 ` [PATCH] RDMA/umad: Reject negative data_len in ib_umad_write YunJe Shin
2026-02-01  9:30   ` Michael Gur
2026-02-02 18:34   ` Jason Gunthorpe
2026-02-03  6:46     ` YunJe Shin
2026-02-03  9:46       ` Leon Romanovsky [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=20260203094629.GQ34749@unreal \
    --to=leon@kernel.org \
    --cc=ioerts@kookmin.ac.kr \
    --cc=jgg@ziepe.ca \
    --cc=joonkyoj@yonsei.ac.kr \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yjshin0438@gmail.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