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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 26 Jun 2010 23:47:22 -0700
From:	"Justin P. Mattock" <justinmattock@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	dhowells@...hat.com, sds@...ho.nsa.gov, lenb@...nel.org,
	linux-bluetooth@...r.kernel.org,
	"Justin P. Mattock" <justinmattock@...il.com>
Subject: [PATCH 1/5]security:key.c Fix warning: variable 'key' set but not used 

building with gcc 4.6 I'm getting a warning message:
 CC      security/keys/keyctl.o
security/keys/keyctl.c: In function 'keyctl_describe_key':
security/keys/keyctl.c:472:14: warning: variable 'key' set but not used

After reading key.h I noticed it says this:
NOTE! key_ref_t is a typedef'd pointer to a type that is not actually
defined. This is because we abuse the bottom bit of the reference to carry a
flag to indicate whether the calling process possesses that key in one of
its keyrings.

In this case the safest approach(in my mind) would be to just
mark the integer __unused. Keep in mind though Im not certain 
if this is the right place for this value i.e. will this effect
*instkey or not(please check).

 Signed-off-by: Justin P. Mattock <justinmattock@...il.com>

---
 security/keys/keyctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 13074b4..d7bb74f 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -469,7 +469,7 @@ long keyctl_describe_key(key_serial_t keyid,
 			 char __user *buffer,
 			 size_t buflen)
 {
-	struct key *key, *instkey;
+	struct key *key __attribute__((unused)), *instkey;
 	key_ref_t key_ref;
 	char *tmpbuf;
 	long ret;
-- 
1.7.1.rc1.21.gf3bd6

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