lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4990743F.1070409@steeleye.com>
Date:	Mon, 09 Feb 2009 13:21:51 -0500
From:	Paul Clements <paul.clements@...eleye.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	kernel list <linux-kernel@...r.kernel.org>,
	jnelson-kernel-bugzilla@...poni.net
Subject: [PATCH 1/1] NBD: fix I/O hang on disconnected nbds

This patch fixes a problem that causes I/O to a disconnected
(or partially initialized) nbd device to hang indefinitely. To reproduce:

# ioctl NBD_SET_SIZE_BLOCKS /dev/nbd23 514048
# dd if=/dev/nbd23 of=/dev/null bs=4096 count=1

...hangs...

This can also occur when an nbd device loses its nbd-client/server
connection. Although we clear the queue of any outstanding I/Os after 
the client/server connection fails, any additional I/Os that get queued 
later will hang.

This bug may also be the problem reported in this bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=12277

Testing would need to be performed to determine if the two issues are 
the same.

This problem was introduced by the new request handling thread code
("NBD: allow nbd to be used locally", 3/2008), which entered into 
mainline around 2.6.25.

The fix, which is fairly simple, is to restore the check for lo->sock
being NULL in do_nbd_request. This causes I/O to an uninitialized nbd to
immediately fail with an I/O error, as it did prior to the introduction 
of this bug.

--
Paul

View attachment "nbd-io-hang.diff" of type "text/x-diff" (1753 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ