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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1347651354-16289-2-git-send-email-levinsasha928@gmail.com>
Date:	Fri, 14 Sep 2012 21:35:54 +0200
From:	Sasha Levin <levinsasha928@...il.com>
To:	tj@...nel.org
Cc:	aris@...hat.com, dan.carpenter@...cle.com, fengguang.wu@...el.com,
	linux-kernel@...r.kernel.org, Sasha Levin <levinsasha928@...il.com>
Subject: [PATCH 2/2] xattr: prevent NULL ptr deref warnings in __simple_xattr_set

Prevent warnings generated by smatch due to unchecked dereference of
'new_xattr' in __simple_xattr_set().

Signed-off-by: Sasha Levin <levinsasha928@...il.com>
---
 fs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xattr.c b/fs/xattr.c
index 508ec1d..f24e5d5 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -880,7 +880,7 @@ static int __simple_xattr_set(struct simple_xattrs *xattrs, const char *name,
 	if (flags & XATTR_REPLACE) {
 		xattr = new_xattr;
 		err = -ENODATA;
-	} else {
+	} else if (new_xattr) {
 		list_add(&new_xattr->list, &xattrs->head);
 		xattr = NULL;
 	}
-- 
1.7.12

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