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: <1193173753.20475.54.camel@heimdal.trondhjem.org>
Date:	Tue, 23 Oct 2007 17:09:13 -0400
From:	Trond Myklebust <Trond.Myklebust@...app.com>
To:	Linus Torvalds <torvalds@...l.org>
Cc:	Chuck Lever <chuck.lever@...cle.com>, Neil Brown <neilb@...e.de>,
	nfs@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [PATCH]NFS: Fix for bug in handling of errors for O_DIRECT writes

From: Neil Brown <neilb@...e.de>

commit eda3cef8dd2b838 ensured that if a WRITE returns an error, then
data->res.verf->committed is not tested (as it is not initialised).

commit 60fa3f769f inadvertently reverted this while fixing other problems.

So move the test so that we never examine ->committed in an error
case, and fix a speeling error while we are there.

Cc: Chuck Lever <chuck.lever@...cle.com>
Signed-off-by: Neil Brown <neilb@...e.de>
Acked-by: Chuck Lever <chuck.lever@...cle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@...app.com>
---
Note: only compile tested - I haven't tried triggering the bug yet.

NeilBrown

### Diffstat output
 ./fs/nfs/direct.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff .prev/fs/nfs/direct.c ./fs/nfs/direct.c
--- .prev/fs/nfs/direct.c	2007-10-23 12:31:29.000000000 +1000
+++ ./fs/nfs/direct.c	2007-10-23 12:32:07.000000000 +1000
@@ -549,13 +549,13 @@ static void nfs_direct_write_result(stru
 
 	spin_lock(&dreq->lock);
 
-	if (unlikely(dreq->error != 0))
-		goto out_unlock;
 	if (unlikely(status < 0)) {
-		/* An error has occured, so we should not commit */
+		/* An error has occurred, so we should not commit */
 		dreq->flags = 0;
 		dreq->error = status;
 	}
+	if (unlikely(dreq->error != 0))
+		goto out_unlock;
 
 	dreq->count += data->res.count;
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ