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]
Date:	Sat, 7 Apr 2007 17:34:43 +0300 (IDT)
From:	amnonaar@...il.com
To:	linux-kernel@...r.kernel.org
Subject: [patch] nfs statfs error-handling fix

Hi,

The nfs statfs function returns a success code on error, and fills the 
output buffer with invalid values. The attached patch makes it return a 
correct error code instead.

Thanks,
Amnon

Signed-off-by: Amnon Aaronsohn <amnonaar@...il.com>
--

--- linux-source-2.6.20-2.6.20/fs/nfs/super.c.orig	2007-04-07 15:19:14.000000000 +0300
+++ linux-source-2.6.20-2.6.20/fs/nfs/super.c	2007-04-07 15:24:35.000000000 +0300
@@ -203,9 +203,9 @@ static int nfs_statfs(struct dentry *den
  	lock_kernel();

  	error = server->nfs_client->rpc_ops->statfs(server, fh, &res);
-	buf->f_type = NFS_SUPER_MAGIC;
  	if (error < 0)
-		goto out_err;
+		goto out;
+	buf->f_type = NFS_SUPER_MAGIC;

  	/*
  	 * Current versions of glibc do not correctly handle the
@@ -234,13 +234,7 @@ static int nfs_statfs(struct dentry *den
  	buf->f_namelen = server->namelen;
   out:
  	unlock_kernel();
-	return 0;
-
- out_err:
-	dprintk("%s: statfs error = %d\n", __FUNCTION__, -error);
-	buf->f_bsize = buf->f_blocks = buf->f_bfree = buf->f_bavail = -1;
-	goto out;
-
+	return error;
  }

  /*
-
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