All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Deep Shah" <deepshah146@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-rc] RDMA/siw: Fix use-after-free in siw_mem_id2obj()
Date: Mon, 02 Nov 2026 06:54:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-192980@kernel.org> (raw)
In-Reply-To: <20261102064437.23976-1-deepshah146@gmail.com>

> siw_mem_id2obj() finds a siw_mem with xa_load() under rcu_read_lock()
> and then takes a reference with kref_get_unless_zero(). This is only
> safe if the object stays allocated until RCU readers are done with it.
> siw_free_mem() frees it with kfree() as soon as the last reference is
> dropped, so a lookup that races with the final put reads freed memory.
> 
> This happens when an MR is deregistered while an incoming RDMA WRITE
> looks up its STag:
> 
>   BUG: KASAN: slab-use-after-free in siw_mem_id2obj+0xe5/0x310
>   Read of size 4 at addr ff110001042aed88 by task repro-rcu2/90
>   Call Trace:
>    <IRQ>
>    siw_mem_id2obj+0xe5/0x310
>    siw_proc_write+0x282/0x430
> [ ... ]
> last put, since a failed lookup never touches it.
> 
> Fixes: 2251334dcac9 ("rdma/siw: application buffer management")
> Cc: stable@vger.kernel.org
> Signed-off-by: Deep Shah <deepshah146@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102064437.23976-1-deepshah146@gmail.com?part=1


  reply	other threads:[~2026-11-02  6:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  6:44 [PATCH rdma-rc] RDMA/siw: Fix use-after-free in siw_mem_id2obj() Deep Shah
2026-11-02  6:54 ` sashiko-bot [this message]
2026-11-03 15:25 ` Leon Romanovsky

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=sashiko-outbox-192980@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=deepshah146@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.