All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [rds?] general protection fault in rds_tcp_accept_one
@ 2026-02-09 15:41 syzbot
  2026-02-10  2:15 ` Forwarded: " syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: syzbot @ 2026-02-09 15:41 UTC (permalink / raw)
  To: allison.henderson, davem, edumazet, horms, kuba, linux-kernel,
	linux-rdma, netdev, pabeni, rds-devel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    9845cf73f7db Add linux-next specific files for 20260205
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=10ec4a5a580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ac78ce3b6729749e
dashboard link: https://syzkaller.appspot.com/bug?extid=96046021045ffe6d7709
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=122acb22580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=149fc7fa580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9f30334a2431/disk-9845cf73.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0d58741a15a6/vmlinux-9845cf73.xz
kernel image: https://storage.googleapis.com/syzbot-assets/62204da1452c/bzImage-9845cf73.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+96046021045ffe6d7709@syzkaller.appspotmail.com

netdevsim netdevsim1 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 UID: 0 PID: 3485 Comm: kworker/u8:8 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: krdsd rds_tcp_accept_worker
RIP: 0010:rds_tcp_accept_one+0xa5b/0xd70 net/rds/tcp_listen.c:319
Code: 00 00 48 83 c3 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 63 a9 2f f7 48 8b 1b 48 83 c3 12 49 89 de 49 c1 ee 03 <43> 0f b6 04 2e 84 c0 0f 85 53 02 00 00 44 0f b6 2b bf 08 00 00 00
RSP: 0018:ffffc9000b64f9a0 EFLAGS: 00010202
RAX: 1ffff1100dacb173 RBX: 0000000000000012 RCX: 0000000000000000
RDX: 0000000000000006 RSI: ffffffff8e006fa9 RDI: 00000000ffffffff
RBP: ffffc9000b64fb18 R08: ffffffff903342b7 R09: 1ffffffff2066856
R10: dffffc0000000000 R11: fffffbfff2066857 R12: ffff88803286c000
R13: dffffc0000000000 R14: 0000000000000002 R15: 1ffff920016c9f3c
FS:  0000000000000000(0000) GS:ffff888125115000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f30359456b8 CR3: 00000000320ee000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 rds_tcp_accept_worker+0x1d/0x70 net/rds/tcp.c:524
 process_one_work+0x949/0x1650 kernel/workqueue.c:3279
 process_scheduled_works kernel/workqueue.c:3362 [inline]
 worker_thread+0xb46/0x1140 kernel/workqueue.c:3443
 kthread+0x388/0x470 kernel/kthread.c:467
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:rds_tcp_accept_one+0xa5b/0xd70 net/rds/tcp_listen.c:319
Code: 00 00 48 83 c3 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 63 a9 2f f7 48 8b 1b 48 83 c3 12 49 89 de 49 c1 ee 03 <43> 0f b6 04 2e 84 c0 0f 85 53 02 00 00 44 0f b6 2b bf 08 00 00 00
RSP: 0018:ffffc9000b64f9a0 EFLAGS: 00010202
RAX: 1ffff1100dacb173 RBX: 0000000000000012 RCX: 0000000000000000
RDX: 0000000000000006 RSI: ffffffff8e006fa9 RDI: 00000000ffffffff
RBP: ffffc9000b64fb18 R08: ffffffff903342b7 R09: 1ffffffff2066856
R10: dffffc0000000000 R11: fffffbfff2066857 R12: ffff88803286c000
R13: dffffc0000000000 R14: 0000000000000002 R15: 1ffff920016c9f3c
FS:  0000000000000000(0000) GS:ffff888125115000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f303594da08 CR3: 000000000e74c000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	48 83 c3 18          	add    $0x18,%rbx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 63 a9 2f f7       	call   0xf72fa97f
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 83 c3 12          	add    $0x12,%rbx
  23:	49 89 de             	mov    %rbx,%r14
  26:	49 c1 ee 03          	shr    $0x3,%r14
* 2a:	43 0f b6 04 2e       	movzbl (%r14,%r13,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 53 02 00 00    	jne    0x28a
  37:	44 0f b6 2b          	movzbl (%rbx),%r13d
  3b:	bf 08 00 00 00       	mov    $0x8,%edi


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Forwarded: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
  2026-02-09 15:41 [syzbot] [rds?] general protection fault in rds_tcp_accept_one syzbot
@ 2026-02-10  2:15 ` syzbot
  2026-02-10  7:05 ` syzbot
  2026-02-10  7:31 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-02-10  2:15 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
Author: allison.henderson@oracle.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main

commit 86b003db7ed7f474c3f462643c2912ffdeb2f876
Author: Allison Henderson <achender@kernel.org>
Date:   Mon Feb 9 18:20:42 2026 -0700

    net/rds: Fix NULL pointer dereference in rds_tcp_accept_one
    
    Hold a local reference to new_sock->sk before installing callbacks
    in rds_tcp_accept_one. After rds_tcp_set_callbacks() or
    rds_tcp_reset_callbacks(), tc->t_sock is set to new_sock which
    may race with the shutdown path.  A concurrent
    rds_tcp_conn_path_shutdown() may call sock_release(), which sets
    new_sock->sk = NULL and frees sk.
    
    Subsequent accesses to new_sock->sk->sk_state dereference NULL,
    causing the null dereference. So a local sock reference with
    sock_hold() before installing callbacks will prevent the race.
    
    Fixes: 826c1004d4ae ("net/rds: rds_tcp_conn_path_shutdown must not discard messages")
    Reported-by: syzbot+96046021045ffe6d7709@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=96046021045ffe6d7709
    Signed-off-by: Allison Henderson <achender@kernel.org>

diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
index 6fb5c928b8fd..cdc86473a1ba 100644
--- a/net/rds/tcp_listen.c
+++ b/net/rds/tcp_listen.c
@@ -177,6 +177,7 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 	struct rds_tcp_connection *rs_tcp = NULL;
 	int conn_state;
 	struct rds_conn_path *cp;
+	struct sock *sk;
 	struct in6_addr *my_addr, *peer_addr;
 #if !IS_ENABLED(CONFIG_IPV6)
 	struct in6_addr saddr, daddr;
@@ -298,6 +299,14 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 		rds_conn_path_drop(cp, 0);
 		goto rst_nsk;
 	}
+	/* Hold a local reference to sk before setting callbacks. Once callbacks
+	 * are set, it is possible for a concurrent rds_tcp_conn_path_shutdown
+	 * call to release the new_sock->sk and set it to NULL.  So we use
+	 * a local sk here to avoid racing with callbacks
+	 */
+	sk = new_sock->sk;
+	sock_hold(sk);
+
 	if (rs_tcp->t_sock) {
 		/* Duelling SYN has been handled in rds_tcp_accept_one() */
 		rds_tcp_reset_callbacks(new_sock, cp);
@@ -316,13 +325,15 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 	 * knowing that "rds_tcp_conn_path_shutdown" will
 	 * dequeue pending messages.
 	 */
-	if (new_sock->sk->sk_state == TCP_CLOSE_WAIT ||
-	    new_sock->sk->sk_state == TCP_LAST_ACK ||
-	    new_sock->sk->sk_state == TCP_CLOSE)
+	if (READ_ONCE(sk->sk_state) == TCP_CLOSE_WAIT ||
+	    READ_ONCE(sk->sk_state) == TCP_LAST_ACK ||
+	    READ_ONCE(sk->sk_state) == TCP_CLOSE)
 		rds_conn_path_drop(cp, 0);
 	else
 		queue_delayed_work(cp->cp_wq, &cp->cp_recv_w, 0);
 
+	sock_put(sk);
+
 	new_sock = NULL;
 	ret = 0;
 	if (conn->c_npaths == 0)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Forwarded: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
  2026-02-09 15:41 [syzbot] [rds?] general protection fault in rds_tcp_accept_one syzbot
  2026-02-10  2:15 ` Forwarded: " syzbot
@ 2026-02-10  7:05 ` syzbot
  2026-02-10  7:31 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-02-10  7:05 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
Author: allison.henderson@oracle.com

#syz test: git@github.com:allisonhenderson/rds_work.git rds_tcp_bug_fixes_v14

commit 86b003db7ed7f474c3f462643c2912ffdeb2f876
Author: Allison Henderson <achender@kernel.org>
Date:   Mon Feb 9 18:20:42 2026 -0700

    net/rds: Fix NULL pointer dereference in rds_tcp_accept_one
    
    Hold a local reference to new_sock->sk before installing callbacks
    in rds_tcp_accept_one. After rds_tcp_set_callbacks() or
    rds_tcp_reset_callbacks(), tc->t_sock is set to new_sock which
    may race with the shutdown path.  A concurrent
    rds_tcp_conn_path_shutdown() may call sock_release(), which sets
    new_sock->sk = NULL and frees sk.
    
    Subsequent accesses to new_sock->sk->sk_state dereference NULL,
    causing the null dereference. So a local sock reference with
    sock_hold() before installing callbacks will prevent the race.
    
    Fixes: 826c1004d4ae ("net/rds: rds_tcp_conn_path_shutdown must not discard messages")
    Reported-by: syzbot+96046021045ffe6d7709@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=96046021045ffe6d7709
    Signed-off-by: Allison Henderson <achender@kernel.org>

diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
index 6fb5c928b8fd..cdc86473a1ba 100644
--- a/net/rds/tcp_listen.c
+++ b/net/rds/tcp_listen.c
@@ -177,6 +177,7 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 	struct rds_tcp_connection *rs_tcp = NULL;
 	int conn_state;
 	struct rds_conn_path *cp;
+	struct sock *sk;
 	struct in6_addr *my_addr, *peer_addr;
 #if !IS_ENABLED(CONFIG_IPV6)
 	struct in6_addr saddr, daddr;
@@ -298,6 +299,14 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 		rds_conn_path_drop(cp, 0);
 		goto rst_nsk;
 	}
+	/* Hold a local reference to sk before setting callbacks. Once callbacks
+	 * are set, it is possible for a concurrent rds_tcp_conn_path_shutdown
+	 * call to release the new_sock->sk and set it to NULL.  So we use
+	 * a local sk here to avoid racing with callbacks
+	 */
+	sk = new_sock->sk;
+	sock_hold(sk);
+
 	if (rs_tcp->t_sock) {
 		/* Duelling SYN has been handled in rds_tcp_accept_one() */
 		rds_tcp_reset_callbacks(new_sock, cp);
@@ -316,13 +325,15 @@ int rds_tcp_accept_one(struct rds_tcp_net *rtn)
 	 * knowing that "rds_tcp_conn_path_shutdown" will
 	 * dequeue pending messages.
 	 */
-	if (new_sock->sk->sk_state == TCP_CLOSE_WAIT ||
-	    new_sock->sk->sk_state == TCP_LAST_ACK ||
-	    new_sock->sk->sk_state == TCP_CLOSE)
+	if (READ_ONCE(sk->sk_state) == TCP_CLOSE_WAIT ||
+	    READ_ONCE(sk->sk_state) == TCP_LAST_ACK ||
+	    READ_ONCE(sk->sk_state) == TCP_CLOSE)
 		rds_conn_path_drop(cp, 0);
 	else
 		queue_delayed_work(cp->cp_wq, &cp->cp_recv_w, 0);
 
+	sock_put(sk);
+
 	new_sock = NULL;
 	ret = 0;
 	if (conn->c_npaths == 0)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Forwarded: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
  2026-02-09 15:41 [syzbot] [rds?] general protection fault in rds_tcp_accept_one syzbot
  2026-02-10  2:15 ` Forwarded: " syzbot
  2026-02-10  7:05 ` syzbot
@ 2026-02-10  7:31 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-02-10  7:31 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [rds?] general protection fault in rds_tcp_accept_one
Author: allison.henderson@oracle.com

#syz test: https://github.com/allisonhenderson/rds_work.git rds_tcp_bug_fixes_v15

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-10  7:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 15:41 [syzbot] [rds?] general protection fault in rds_tcp_accept_one syzbot
2026-02-10  2:15 ` Forwarded: " syzbot
2026-02-10  7:05 ` syzbot
2026-02-10  7:31 ` syzbot

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.