Forwarded: [PATCH] nbd: move sk_set_memalloc out of tx_lock critical section

From: syzbot

Date: Tue Nov 10 2026 - 12:57:55 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: [PATCH] nbd: move sk_set_memalloc out of tx_lock critical section
Author: timo.joannin@xxxxxxxxx

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index ffce519bf008..5112e3a03027 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1369,12 +1369,12 @@ static int nbd_genl_reconnect_sock_cb(struct nbd_device *nbd, unsigned long arg)
if (!nsock->dead)
continue;

+ sk_set_memalloc(sock->sk);
mutex_lock(&nsock->tx_lock);
if (!nsock->dead) {
mutex_unlock(&nsock->tx_lock);
continue;
}
- sk_set_memalloc(sock->sk);
if (nbd->tag_set.timeout)
sock->sk->sk_sndtimeo = nbd->tag_set.timeout;
atomic_inc(&config->recv_threads);
--
2.56.0