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>] [day] [month] [year] [list]
Message-ID: <4058793.1720703979@warthog.procyon.org.uk>
Date: Thu, 11 Jul 2024 14:19:39 +0100
From: David Howells <dhowells@...hat.com>
To: Eric Van Hensbergen <ericvh@...nel.org>,
    Latchesar Ionkov <lucho@...kov.net>,
    Dominique Martinet <asmadeus@...ewreck.org>
cc: dhowells@...hat.com, Christian Schoenebeck <linux_oss@...debyte.com>,
    v9fs@...ts.linux.dev, netfs@...ts.linux.dev,
    linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] 9p: Fix O_NONBLOCK read behaviour in P9L_DIRECT mode

With the 9p filesystem, in P9L_DIRECT mode, if O_NONBLOCK is set, a read
should terminate after doing one piece of I/O.

Fixes: 80105ed2fd27 ("9p: Use netfslib read/write_iter")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218916
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Eric Van Hensbergen <ericvh@...nel.org>
cc: Latchesar Ionkov <lucho@...kov.net>
cc: Dominique Martinet <asmadeus@...ewreck.org>
cc: Christian Schoenebeck <linux_oss@...debyte.com>
cc: v9fs@...ts.linux.dev
cc: netfs@...ts.linux.dev
cc: linux-fsdevel@...r.kernel.org
---
 fs/9p/vfs_addr.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index a97ceb105cd8..b443024bf715 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -77,6 +77,10 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
 	 * cache won't be on server and is zeroes */
 	__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
 
+	if ((fid->mode & P9L_DIRECT) &&
+	    test_bit(NETFS_RREQ_NONBLOCK, &rreq->flags))
+		set_bit(NETFS_RREQ_BLOCKED, &rreq->flags);
+
 	netfs_subreq_terminated(subreq, err ?: total, false);
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ