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: <1426825147-26981-1-git-send-email-tsgatesv@gmail.com>
Date:	Fri, 20 Mar 2015 00:19:07 -0400
From:	Taesoo Kim <tsgatesv@...il.com>
To:	jaegeuk@...nel.org, cm224.lee@...sung.com,
	linux-f2fs-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Cc:	taesoo@...ech.edu, changwoo@...ech.edu, sanidhya@...ech.edu,
	blee@...ech.edu, csong84@...ech.edu,
	Taesoo Kim <tsgatesv@...il.com>
Subject: [PATCH 1/1] f2fs: correctly check empty xattr key

When xattr name (key) is empty (""), correctly return -EINVAL
error. xattr_advise_set/get() seem to make the same mistake.

Signed-off-by: Taesoo Kim <tsgatesv@...il.com>
---
 fs/f2fs/xattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index 5072bf9..6b1fbc4 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -132,7 +132,7 @@ static int f2fs_xattr_advise_get(struct dentry *dentry, const char *name,
 {
 	struct inode *inode = dentry->d_inode;
 
-	if (strcmp(name, "") != 0)
+	if (strcmp(name, "") == 0)
 		return -EINVAL;
 
 	*((char *)buffer) = F2FS_I(inode)->i_advise;
@@ -144,7 +144,7 @@ static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name,
 {
 	struct inode *inode = dentry->d_inode;
 
-	if (strcmp(name, "") != 0)
+	if (strcmp(name, "") == 0)
 		return -EINVAL;
 	if (!inode_owner_or_capable(inode))
 		return -EPERM;
-- 
2.3.3

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