Forwarded: BUG:[syzbot] [net?] kernel BUG in pn_socket_autobind
From: syzbot
Date: Sun Apr 26 2026 - 03:50:30 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.
***
Subject: BUG:[syzbot] [net?] kernel BUG in pn_socket_autobind
Author: suresh.k.chandrappa@xxxxxxxxx
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index c4af26357144..522512094b13 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -210,7 +210,8 @@ static int pn_socket_autobind(struct socket *sock)
sizeof(struct sockaddr_pn));
if (err != -EINVAL)
return err;
- BUG_ON(!pn_port(pn_sk(sock->sk)->sobject));
+ if (!pn_port(pn_sk(sock->sk)->sobject))
+ return -ENOBUFS;
return 0; /* socket was already bound */
}