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: <1276725021-9057-1-git-send-email-jslaby@suse.cz>
Date:	Wed, 16 Jun 2010 23:50:21 +0200
From:	Jiri Slaby <jslaby@...e.cz>
To:	viro@...iv.linux.org.uk
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	jirislaby@...il.com, Christoph Hellwig <hch@....de>
Subject: [PATCH 1/1] FS: attr, check ATTR_SIZE in ia_valid not ia_mode

Fix a bug introduced by commit "check ATTR_SIZE contraints in
inode_change_ok" which added a size check, but checks the size even if
ATTR_SIZE is not in attr->ia_valid because it tests the bit in
attr->ia_mode.

Test properly against ia_valid.

Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Christoph Hellwig <hch@....de>
Cc: Al Viro <viro@...iv.linux.org.uk>
---
 fs/attr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 6959666..7ca4181 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -34,7 +34,7 @@ int inode_change_ok(const struct inode *inode, struct iattr *attr)
 	 * First check size constraints.  These can't be overriden using
 	 * ATTR_FORCE.
 	 */
-	if (attr->ia_mode & ATTR_SIZE) {
+	if (ia_valid & ATTR_SIZE) {
 		int error = inode_newsize_ok(inode, attr->ia_size);
 		if (error)
 			return error;
-- 
1.7.1


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