All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Petr Vorel <pvorel@suse.cz>
Cc: Andrea Cervesato <andrea.cervesato@suse.de>,
	Linux Test Project <ltp@lists.linux.it>,
	Eric Biggers <ebiggers3@gmail.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com
Subject: Re: [LTP] [PATCH 2/2] device-drivers/rdma: Add ucma_uaf01 test
Date: Sun, 12 Apr 2026 17:14:39 +0300	[thread overview]
Message-ID: <20260412141439.GD21470@unreal> (raw)
In-Reply-To: <20260407132426.GC25645@pevik>

On Tue, Apr 07, 2026 at 03:24:26PM +0200, Petr Vorel wrote:
> Hi Andrea,
> 
> it's been long time since this use-after-free was fixed, but IMHO still useful
> to have a test (it's also kind of smoke test for rdma_cm).
> Anyway, LGTM, but it'd be nice to reproduce the bug.
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
> > Test for use-after-free in RDMA UCMA triggered by racing CREATE_ID,
> > BIND_IP, and LISTEN operations. Three threads concurrently issue
> > these commands to /dev/infiniband/rdma_cm and the test checks for
> > kernel taint (KASAN use-after-free detection).
> 
> > The bug was fixed by kernel commit 5fe23f262e05
> > ("ucma: fix a use-after-free in ucma_resolve_ip()").
> 
> > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > ---
> >  runtest/kernel_misc                               |   1 +
> >  testcases/kernel/device-drivers/Makefile          |   1 +
> >  testcases/kernel/device-drivers/rdma/.gitignore   |   1 +
> >  testcases/kernel/device-drivers/rdma/Makefile     |   7 +
> >  testcases/kernel/device-drivers/rdma/ucma_uaf01.c | 208 ++++++++++++++++++++++
> >  5 files changed, 218 insertions(+)

<...>

> > +static struct tst_test test = {
> > +	.test_all = run,
> > +	.setup = setup,
> > +	.cleanup = cleanup,
> > +	.runtime = 300,
> > +	.needs_root = 1,
> > +	.taint_check = TST_TAINT_W | TST_TAINT_D,
> > +	.needs_kconfigs = (const char *[]) {
> > +		"CONFIG_INFINIBAND",
> > +		"CONFIG_INFINIBAND_USER_ACCESS",

I’m not familiar with the LTP tests, but I wanted to point out that these
config options are insufficient. You need an actual or virtual RDMA device
connected to rdma-cm for the tests to work correctly.

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: rds-devel@oss.oracle.com, linux-rdma@vger.kernel.org,
	Eric Biggers <ebiggers3@gmail.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Doug Ledford <dledford@redhat.com>,
	Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH 2/2] device-drivers/rdma: Add ucma_uaf01 test
Date: Sun, 12 Apr 2026 17:14:39 +0300	[thread overview]
Message-ID: <20260412141439.GD21470@unreal> (raw)
In-Reply-To: <20260407132426.GC25645@pevik>

On Tue, Apr 07, 2026 at 03:24:26PM +0200, Petr Vorel wrote:
> Hi Andrea,
> 
> it's been long time since this use-after-free was fixed, but IMHO still useful
> to have a test (it's also kind of smoke test for rdma_cm).
> Anyway, LGTM, but it'd be nice to reproduce the bug.
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
> > Test for use-after-free in RDMA UCMA triggered by racing CREATE_ID,
> > BIND_IP, and LISTEN operations. Three threads concurrently issue
> > these commands to /dev/infiniband/rdma_cm and the test checks for
> > kernel taint (KASAN use-after-free detection).
> 
> > The bug was fixed by kernel commit 5fe23f262e05
> > ("ucma: fix a use-after-free in ucma_resolve_ip()").
> 
> > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > ---
> >  runtest/kernel_misc                               |   1 +
> >  testcases/kernel/device-drivers/Makefile          |   1 +
> >  testcases/kernel/device-drivers/rdma/.gitignore   |   1 +
> >  testcases/kernel/device-drivers/rdma/Makefile     |   7 +
> >  testcases/kernel/device-drivers/rdma/ucma_uaf01.c | 208 ++++++++++++++++++++++
> >  5 files changed, 218 insertions(+)

<...>

> > +static struct tst_test test = {
> > +	.test_all = run,
> > +	.setup = setup,
> > +	.cleanup = cleanup,
> > +	.runtime = 300,
> > +	.needs_root = 1,
> > +	.taint_check = TST_TAINT_W | TST_TAINT_D,
> > +	.needs_kconfigs = (const char *[]) {
> > +		"CONFIG_INFINIBAND",
> > +		"CONFIG_INFINIBAND_USER_ACCESS",

I’m not familiar with the LTP tests, but I wanted to point out that these
config options are insufficient. You need an actual or virtual RDMA device
connected to rdma-cm for the tests to work correctly.

Thanks

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-04-12 14:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 15:25 [LTP] [PATCH 0/2] Add infiniband testing suite Andrea Cervesato
2026-03-25 15:25 ` [LTP] [PATCH 1/2] lapi: Add fallback rdma_user_cm.h definitions Andrea Cervesato
2026-04-17 12:02   ` [LTP] " linuxtestproject.agent
2026-03-25 15:25 ` [LTP] [PATCH 2/2] device-drivers/rdma: Add ucma_uaf01 test Andrea Cervesato
2026-04-07 13:24   ` Petr Vorel
2026-04-07 13:24     ` Petr Vorel
2026-04-12 14:14     ` Leon Romanovsky [this message]
2026-04-12 14:14       ` Leon Romanovsky via ltp
2026-04-14  7:30       ` Petr Vorel
2026-04-14  7:30         ` Petr Vorel
2026-04-14  9:17         ` Leon Romanovsky
2026-04-14  9:17           ` Leon Romanovsky via ltp
2026-04-23  9:27           ` Petr Vorel
2026-04-23  9:27             ` Petr Vorel
2026-04-08  7:16   ` Petr Vorel
2026-04-07 12:56 ` [LTP] [PATCH 0/2] Add infiniband testing suite Petr Vorel

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=20260412141439.GD21470@unreal \
    --to=leon@kernel.org \
    --cc=andrea.cervesato@suse.de \
    --cc=dledford@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    --cc=rds-devel@oss.oracle.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 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.