WARNING in rdma_resolve_addr

Status: upstream: reported C repro on 2026/11/01 05:32
Subsystems: rdma
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+6699995b421c8ec7d2fe@syzkaller.appspotmail.com
First crash: 4d05h, last: 19h48m
✨ AI-generated root cause summary:

A race condition exists in resolve_prepare_src() in drivers/infiniband/core/cma.c when binding an address during rdma_resolve_addr(). Calling cma_bind_addr() transitions id_priv->state to RDMA_CM_ADDR_BOUND and attaches id_priv to cma_dev->id_list, exposing it to concurrent device removal via cma_process_remove() / cma_send_device_removal_put(), which sets id_priv->state to RDMA_CM_DEVICE_REMOVAL. When this occurs before resolve_prepare_src() executes cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY), the state check fails and triggers a false-positive WARN_ON(), returning -EINVAL which is handled cleanly by callers without memory corruption or DoS.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 65ba8f34ec88:

Technical Root Cause Analysis

1. Overview & Location

  • Subsystem: RDMA / Communication Manager (drivers/infiniband/core/cma.c)
  • Functions involved: resolve_prepare_src(), cma_bind_addr(), rdma_bind_addr_dst(), cma_process_remove(), cma_send_device_removal_put()
  • Structs & Fields: struct rdma_id_private::state, struct rdma_id_private::device_item, struct cma_device::id_list
  • File: drivers/infiniband/core/cma.c

2. Mechanism & Invariant Violation

When an RDMA Communication Manager ID is created via rdma_create_id() (as in rds_ib_conn_path_connect()), its state is initialized to RDMA_CM_IDLE (0).

When resolving an address via rdma_resolve_addr(), it calls resolve_prepare_src():

static int resolve_prepare_src(struct rdma_id_private *id_priv,
			       struct sockaddr *src_addr,
			       const struct sockaddr *dst_addr)
{
	int ret;

	if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY)) {
		/* For a well behaved ULP state will be RDMA_CM_IDLE */
		ret = cma_bind_addr(&id_priv->id, src_addr, dst_addr);
		if (ret)
			return ret;
		if (WARN_ON(!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND,
					   RDMA_CM_ADDR_QUERY)))
			return -EINVAL;
	}
...

The bug is triggered as follows:

  1. Since the ID is initially RDMA_CM_IDLE, the first cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY) returns false (0).
  2. The function proceeds into the if branch and invokes cma_bind_addr(), which calls rdma_bind_addr_dst().
  3. In rdma_bind_addr_dst(), id_priv->state is transitioned from RDMA_CM_IDLE to RDMA_CM_ADDR_BOUND (7).
  4. Because a non-wildcard source IP is specified, rdma_bind_addr_dst() calls cma_acquire_dev_by_src_ip(id_priv), which in turn calls cma_attach_to_dev() and adds id_priv->device_item to cma_dev->id_list.
  5. Once attached to the device's list, id_priv becomes visible to concurrent device removal handling. If the underlying RDMA device is concurrently removed or unbound (e.g. cma_process_remove()), it iterates over cma_dev->id_list and calls cma_send_device_removal_put(id_priv).
  6. Inside cma_send_device_removal_put(), id_priv->lock is acquired and id_priv->state is transitioned to RDMA_CM_DEVICE_REMOVAL (9) (which matches the crash register value R14 = 0x9).
  7. When control returns to resolve_prepare_src() and it attempts to execute:
    WARN_ON(!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY))
    
    the comparison id_priv->state == RDMA_CM_ADDR_BOUND evaluates to false because id_priv->state is now RDMA_CM_DEVICE_REMOVAL.
  8. The WARN_ON fires due to the false assumption that id_priv->state cannot change between cma_bind_addr() returning 0 and the subsequent cma_comp_exch().

3. Runtime Consequences in Production

  • Memory Corruption: None. The state mismatch only causes the exchange to fail, without corrupting pointers, refcounts, or memory.
  • Information Leak: None. No kernel memory contents or addresses are exposed or copied to userspace.
  • Denial of Service: None. In a production build without panic_on_warn, WARN_ON logs a warning and does not panic the system. The function returns -EINVAL, causing rdma_resolve_addr() to return -EINVAL. Its caller (rds_ib_conn_path_connect()) checks this error, tears down the ID via rdma_destroy_id(), and cleanly drops the connection attempt without hanging or leaking memory.
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
3aae21a7 repro-c Reproduced: ✅ ❓ WARNING in rdma_resolve_addr 2026/10/31 12:11 2026/10/31 12:11 2026/10/31 14:11 2041d3f8
93c5ec82 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ WARNING in rdma_resolve_addr 2026/10/29 03:49 2026/10/29 03:49 2026/10/29 04:01 b1d00f76
▶ ▼ Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [rdma?] WARNING in rdma_resolve_addr 0 (2) 2026/11/01 08:17
▶ ▼ Last patch testing requests (2)
Created Duration User Patch Repo Result
2026/11/01 08:17 20m kartikey406@gmail.com patch upstream OK job log log
2026/10/31 14:45 20m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 36aad21d50d1af3f6954bb0c988257a908202477 report job log log

Sample crash report:
------------[ cut here ]------------
!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY)
WARNING: drivers/infiniband/core/cma.c:4120 at resolve_prepare_src drivers/infiniband/core/cma.c:4120 [inline], CPU#1: kworker/u8:8/1176
WARNING: drivers/infiniband/core/cma.c:4120 at rdma_resolve_addr+0x3f1/0x20e0 drivers/infiniband/core/cma.c:4146, CPU#1: kworker/u8:8/1176
Modules linked in:
CPU: 1 UID: 0 PID: 1176 Comm: kworker/u8:8 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026
Workqueue: krds_cp_wq#43/0 rds_connect_worker
RIP: 0010:resolve_prepare_src drivers/infiniband/core/cma.c:4120 [inline]
RIP: 0010:rdma_resolve_addr+0x3f1/0x20e0 drivers/infiniband/core/cma.c:4146
Code: 02 00 00 44 89 f6 e8 3e f2 14 f9 41 83 fe 07 0f 84 09 07 00 00 e8 bf f7 14 f9 48 8b bd 18 ff ff ff 48 89 de e8 10 3f f7 02 90 <0f> 0b 90 bb ea ff ff ff e9 57 fd ff ff e8 9d f7 14 f9 49 8d 7c 24
RSP: 0018:ffffc900052ff8b0 EFLAGS: 00010286
RAX: 8000000000000001 RBX: 0000000000000293 RCX: 0000000000000000
RDX: 0000000000000004 RSI: ffffffff8e6277e2 RDI: 0000000000000001
RBP: ffffc900052ffa00 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffffc900052ffb00
R13: 0000000000001388 R14: 0000000000000009 R15: ffffc900052ffa60
FS:  0000000000000000(0000) GS:ffff88812257f000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000560c3d47e9f8 CR3: 0000000020ebc000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 rds_ib_conn_path_connect+0x415/0x5d0 net/rds/ib_cm.c:1044
 rds_connect_worker+0x1b4/0x2d0 net/rds/threads.c:176
 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495
 process_scheduled_works kernel/workqueue.c:3578 [inline]
 worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659
 kthread+0x373/0x450 kernel/kthread.c:436
 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/31 15:05 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 36aad21d50d1 96923c60 .config console log report C ci-upstream-kasan-gce-selinux-root WARNING in rdma_resolve_addr
2026/10/28 05:23 upstream 65ba8f34ec88 96923c60 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING in rdma_resolve_addr
* Struck through repros no longer work on HEAD.