All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serhat Kumral <serhatkumral1@gmail.com>
To: leon@kernel.org
Cc: jgg@ziepe.ca, parav@nvidia.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/core: Fix use-after-free when netns exit races compat dev removal
Date: Thu,  3 Sep 2026 12:46:25 +0300	[thread overview]
Message-ID: <20260903094625.18465-1-serhatkumral1@gmail.com> (raw)
In-Reply-To: <20260902075653.GS24140@unreal>

> Please don't trim kernel panic logs. Please post the full output,
> including the steps required to reproduce the issue.

sure,

-----------------------------------------------------------------------------
  i=1
  while [ "$i" -le 200 ]; do
  	dev="rxed$i"

  	unshare -n /bin/sh -c "
  		ip link add ${dev} type dummy || exit 1
  		ip link set ${dev} up || exit 1
  		ip addr add 198.51.100.1/24 dev ${dev} || exit 1
  		rdma link add rxe${i} type rxe netdev ${dev} || exit 1
  		sleep 0.2
  		ip link set ${dev} netns 1 || exit 1
  	" || echo "iteration $i failed"

  	sleep 0.05
  	ip link del "$dev" 2>/dev/null
  	i=$((i + 1))
  done
-----------------------------------------------------------------------------
Run in a qemu guest with -enable-kvm.

-----------------------------------------------------------------------------

[   50.325096] ==================================================================
[   50.325099] BUG: KASAN: slab-use-after-free in kobject_uevent_env+0xb6f/0xc80
[   50.325118] Read of size 8 at addr ffff8881084d0250 by task kworker/u32:1/62
[   50.325120] 
[   50.325123] CPU: 3 UID: 0 PID: 62 Comm: kworker/u32:1 Not tainted 7.3.0-rc1 #1 PREEMPT(lazy) 
[   50.325126] Hardware name: QEMU Ubuntu 26.04 PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[   50.325128] Workqueue: ib-unreg-wq ib_unregister_work
[   50.325133] Call Trace:
[   50.325134]  <TASK>
[   50.325135]  dump_stack_lvl+0x5d/0x80
[   50.325140]  print_report+0x153/0x4b1
[   50.325143]  ? kobject_uevent_env+0xb6f/0xc80
[   50.325145]  ? __virt_addr_valid+0x221/0x4c0
[   50.325148]  ? kobject_uevent_env+0xb6f/0xc80
[   50.325150]  kasan_report+0xe4/0x1a0
[   50.325153]  ? kobject_uevent_env+0xb6f/0xc80
[   50.325155]  ? __pfx_device_namespace+0x10/0x10
[   50.325159]  kobject_uevent_env+0xb6f/0xc80
[   50.325161]  device_del+0x737/0xc10
[   50.325164]  ? __pfx_device_del+0x10/0x10
[   50.325166]  ? __kobject_del+0xcb/0x310
[   50.325168]  disable_device+0x1ad/0x230
[   50.325169]  ? __pfx_disable_device+0x10/0x10
[   50.325172]  __ib_unregister_device+0x229/0x3f0
[   50.325174]  ? process_one_work+0x790/0x1630
[   50.325177]  ib_unregister_work+0x14/0x30
[   50.325178]  process_one_work+0x8e1/0x1630
[   50.325181]  ? __pfx_process_one_work+0x10/0x10
[   50.325183]  ? lock_acquire+0x18c/0x300
[   50.325186]  ? lock_is_held_type+0x87/0xf0
[   50.325189]  worker_thread+0x4af/0xd20
[   50.325192]  ? __pfx_worker_thread+0x10/0x10
[   50.325193]  kthread+0x2ce/0x3a0
[   50.325195]  ? _raw_spin_unlock_irq+0x23/0x40
[   50.325199]  ? __pfx_kthread+0x10/0x10
[   50.325200]  ret_from_fork+0x520/0x770
[   50.325203]  ? __pfx_ret_from_fork+0x10/0x10
[   50.325205]  ? __switch_to+0x58a/0xf60
[   50.325207]  ? __pfx_kthread+0x10/0x10
[   50.325209]  ret_from_fork_asm+0x1a/0x30
[   50.325212]  </TASK>
[   50.325213] 
[   50.325213] Allocated by task 1409:
[   50.325215]  kasan_save_stack+0x30/0x50
[   50.325217]  kasan_save_track+0x14/0x30
[   50.325218]  __kasan_kmalloc+0x7f/0x90
[   50.325221]  __kmalloc_cache_noprof+0x223/0x510
[   50.325224]  uevent_net_init+0xcf/0x2f0
[   50.325225]  ops_init+0x185/0x560
[   50.325228]  setup_net+0xf7/0x320
[   50.325229]  copy_net_ns+0x225/0x400
[   50.325231]  create_new_namespaces+0x358/0x9e0
[   50.325234]  unshare_nsproxy_namespaces+0x9c/0x140
[   50.325239]  ksys_unshare+0x4dd/0x770
[   50.325241]  __x64_sys_unshare+0x2f/0x50
[   50.325243]  do_syscall_64+0x106/0x5f0
[   50.325245]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   50.325248] 
[   50.325249] Freed by task 12:
[   50.325250]  kasan_save_stack+0x30/0x50
[   50.325251]  kasan_save_track+0x14/0x30
[   50.325252]  kasan_save_free_info+0x3b/0x70
[   50.325254]  __kasan_slab_free+0x47/0x70
[   50.325256]  kfree+0x1b3/0x550
[   50.325257]  ops_undo_list+0x273/0x8c0
[   50.325259]  cleanup_net+0x3b3/0x720
[   50.325261]  process_one_work+0x8e1/0x1630
[   50.325262]  worker_thread+0x4af/0xd20
[   50.325264]  kthread+0x2ce/0x3a0
[   50.325265]  ret_from_fork+0x520/0x770
[   50.325267]  ret_from_fork_asm+0x1a/0x30
[   50.325269] 
[   50.325269] The buggy address belongs to the object at ffff8881084d0240
[   50.325269]  which belongs to the cache kmalloc-32 of size 32
[   50.325271] The buggy address is located 16 bytes inside of
[   50.325271]  freed 32-byte region [ffff8881084d0240, ffff8881084d0260)
[   50.325273] 
[   50.325273] The buggy address belongs to the physical page:
[   50.325275] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881084d0c80 pfn:0x1084d0
[   50.325277] flags: 0x200000000000200(workingset|node=0|zone=2)
[   50.325279] page_type: f5(slab)
[   50.325282] raw: 0200000000000200 ffff888100042780 ffffea000427e690 ffffea0004039fd0
[   50.325284] raw: ffff8881084d0c80 000000000040002a 00000000f5000000 0000000000000000
[   50.325285] page dumped because: kasan: bad access detected
[   50.325286] 
[   50.325286] Memory state around the buggy address:
[   50.325287]  ffff8881084d0100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.325288]  ffff8881084d0180: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.325289] >ffff8881084d0200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.325290]                                                  ^
[   50.325291]  ffff8881084d0280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.325292]  ffff8881084d0300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.325293] ==================================================================

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  8:09 [PATCH] RDMA/core: Fix use-after-free when netns exit races compat dev removal Serhat Kumral
2026-09-02  7:56 ` Leon Romanovsky
2026-09-03  9:46   ` Serhat Kumral [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=20260903094625.18465-1-serhatkumral1@gmail.com \
    --to=serhatkumral1@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=parav@nvidia.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.