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]
Date:	Wed, 20 Feb 2013 11:30:28 -0800
From:	Randy Dunlap <rdunlap@...radead.org>
To:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
CC:	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Mimi Zohar <zohar@...ibm.com>, axboe@...nel.dk
Subject: [PATCH -next] security/integrity/ima: make part_pack_uuid() always
 visible

On 02/20/13 08:50, Mimi Zohar wrote:
> On Tue, 2013-02-19 at 16:28 -0800, Randy Dunlap wrote:
>> On 02/18/13 22:03, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> Changes since 20130218:
>>>
>>
>> on x86_64:
>>
>>   CC      security/integrity/ima/ima_policy.o
>> security/integrity/ima/ima_policy.c: In function 'ima_parse_rule':
>> security/integrity/ima/ima_policy.c:538:4: error: implicit declaration of function 'part_pack_uuid' [-Werror=implicit-function-declaration]
>> cc1: some warnings being treated as errors
>> make[4]: *** [security/integrity/ima/ima_policy.o] Error 1
>>
>>
>> Full randconfig file is attached.
> 
> part_pack_uuid() is only defined for CONFIG_BLOCK in
> include/linux/genhd.h.  One solution would be to add a stub function
> definition in include/linux/genhd.h, the other option would be to ifndef
> CONFIG_BLOCK in C code.

ITYM #ifdef CONFIG_BLOCK to call part_pack_uuid().
Yes, either of those would work.
How about a third option -- just make part_pack_uuid() always visible
and not just a stub?  Patch is below.


---
From: Randy Dunlap <rdunlap@...radead.org>

Fix build error when CONFIG_BLOCK is not enabled
by making the static inline function part_pack_uuid()
visible independent of CONFIG_BLOCK's setting.

security/integrity/ima/ima_policy.c:538:4: error: implicit declaration of function 'part_pack_uuid' [-Werror=implicit-function-declaration]

Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Mimi Zohar <zohar@...ibm.com>
---
 include/linux/genhd.h |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

--- linux-next-20130220.orig/include/linux/genhd.h
+++ linux-next-20130220/include/linux/genhd.h
@@ -213,24 +213,6 @@ static inline struct gendisk *part_to_di
 	return NULL;
 }
 
-static inline void part_pack_uuid(const u8 *uuid_str, u8 *to)
-{
-	int i;
-	for (i = 0; i < 16; ++i) {
-		*to++ = (hex_to_bin(*uuid_str) << 4) |
-			(hex_to_bin(*(uuid_str + 1)));
-		uuid_str += 2;
-		switch (i) {
-		case 3:
-		case 5:
-		case 7:
-		case 9:
-			uuid_str++;
-			continue;
-		}
-	}
-}
-
 static inline int disk_max_parts(struct gendisk *disk)
 {
 	if (disk->flags & GENHD_FL_EXT_DEVT)
@@ -720,4 +702,22 @@ static inline dev_t blk_lookup_devt(cons
 
 #endif /* CONFIG_BLOCK */
 
+static inline void part_pack_uuid(const u8 *uuid_str, u8 *to)
+{
+	int i;
+	for (i = 0; i < 16; ++i) {
+		*to++ = (hex_to_bin(*uuid_str) << 4) |
+			(hex_to_bin(*(uuid_str + 1)));
+		uuid_str += 2;
+		switch (i) {
+		case 3:
+		case 5:
+		case 7:
+		case 9:
+			uuid_str++;
+			continue;
+		}
+	}
+}
+
 #endif /* _LINUX_GENHD_H */
--
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