* [PATCH V2] nbd: Reclassify sockets in the reconnect path
@ 2026-11-12 10:59 Guilherme Giacomo Simoes
0 siblings, 0 replies; only message in thread
From: Guilherme Giacomo Simoes @ 2026-11-12 10:59 UTC (permalink / raw)
To: josef, axboe
Cc: linux-block, nbd, linux-kernel, Guilherme Giacomo Simoes,
syzbot+d7d72f3d467710442af0
Commit d532cddb6c60 ("nbd: Reclassify sockets to avoid lockdep circular
dependency") introduced nbd_reclassify_socket() to prevent lockdep false
positives when NBD sockets are used in memory reclaim paths. While
nbd_add_socket() reclassifies newly added sockets,
nbd_genl_reconnect_sock_cb() omitted this call when replacing dead
sockets during reconnection. Consequently, reconnected sockets retain
the generic socket lockdep class and trigger false-positive lockdep
reports.
Fix this by reclassifying the replacement socket in
nbd_genl_reconnect_sock_cb().
Fixes: d532cddb6c60 ("nbd: Reclassify sockets to avoid lockdep circular dependency")
Reported-by: syzbot+d7d72f3d467710442af0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d7d72f3d467710442af0
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
---
v2:
- change previous patch to a single line addition of
nbd_reclassify_socket()
- improve commit message
v1:
https://lore.kernel.org/all/20261110215723.199948-1-trintaeoitogc@gmail.com/
---
drivers/block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index ffce519bf008..b2b27f90a7ed 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1356,6 +1356,7 @@ static int nbd_genl_reconnect_sock_cb(struct nbd_device *nbd, unsigned long arg)
sock = nbd_get_socket(nbd, arg, &err);
if (!sock)
return err;
+ nbd_reclassify_socket(sock);
args = kzalloc_obj(*args);
if (!args) {
--
2.52.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-12 10:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 10:59 [PATCH V2] nbd: Reclassify sockets in the reconnect path Guilherme Giacomo Simoes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®