linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.24-rc3-mm2 - add-64-bit-capability-support-to-the-kernel
@ 2007-12-01  8:18 Valdis.Kletnieks
  2007-12-03 15:03 ` Serge E. Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks @ 2007-12-01  8:18 UTC (permalink / raw)
  To: Andrew Morgan; +Cc: Serge Hallyn, Andrew Morton, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

Question:

The patch does the semantic equivalent of:

-#define cap_clear(c)         do { cap_t(c) =  0; } while(0)
-#define cap_set_full(c)      do { cap_t(c) = ~0; } while(0)

+# define cap_clear(c)         do { (c) = __cap_empty_set; } while (0)
+# define cap_set_full(c)      do { (c) = __cap_full_set; } while (0)
+# define cap_set_init_eff(c)  do { (c) = __cap_init_eff_set; } while (0)

Was it intentional, or an oversight, that this blows chunks in modules
that try to use cap_clear() or cap_set_full() because the __cap_*
symbols don't get an EXPORT_SYMBOL() attached to them?

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.6.24-rc3-mm2 - add-64-bit-capability-support-to-the-kernel
  2007-12-01  8:18 2.6.24-rc3-mm2 - add-64-bit-capability-support-to-the-kernel Valdis.Kletnieks
@ 2007-12-03 15:03 ` Serge E. Hallyn
  2007-12-06  1:46   ` Andrew Morgan
  0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2007-12-03 15:03 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Andrew Morgan, Serge Hallyn, Andrew Morton, linux-kernel

Quoting Valdis.Kletnieks@vt.edu (Valdis.Kletnieks@vt.edu):
> Question:
> 
> The patch does the semantic equivalent of:
> 
> -#define cap_clear(c)         do { cap_t(c) =  0; } while(0)
> -#define cap_set_full(c)      do { cap_t(c) = ~0; } while(0)
> 
> +# define cap_clear(c)         do { (c) = __cap_empty_set; } while (0)
> +# define cap_set_full(c)      do { (c) = __cap_full_set; } while (0)
> +# define cap_set_init_eff(c)  do { (c) = __cap_init_eff_set; } while (0)
> 
> Was it intentional, or an oversight, that this blows chunks in modules
> that try to use cap_clear() or cap_set_full() because the __cap_*
> symbols don't get an EXPORT_SYMBOL() attached to them?

I think that's one big oops, and the following is needed.

>From 9c217a6280b559cca28edab621d2d22288ce0ac6 Mon Sep 17 00:00:00 2001
From: Serge E. Hallyn <serue@us.ibm.com>
Date: Mon, 3 Dec 2007 09:59:50 -0500
Subject: [PATCH 1/1] capabilities: export __cap_ symbols

Export __cap_empty_set and friends so that the cap_clear(),
cap_set_full() and cap_set_init_eff() defines can be used
by modules.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 kernel/capability.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/capability.c b/kernel/capability.c
index 9f2db55..064eb8a 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -29,6 +29,10 @@ const kernel_cap_t __cap_empty_set = CAP_EMPTY_SET;
 const kernel_cap_t __cap_full_set = CAP_FULL_SET;
 const kernel_cap_t __cap_init_eff_set = CAP_INIT_EFF_SET;
 
+EXPORT_SYMBOL(__cap_empty_set);
+EXPORT_SYMBOL(__cap_full_set);
+EXPORT_SYMBOL(__cap_init_eff_set);
+
 /*
  * For sys_getproccap() and sys_setproccap(), any of the three
  * capability set pointers may be NULL -- indicating that that set is
-- 
1.5.1.1.GIT



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: 2.6.24-rc3-mm2 - add-64-bit-capability-support-to-the-kernel
  2007-12-03 15:03 ` Serge E. Hallyn
@ 2007-12-06  1:46   ` Andrew Morgan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morgan @ 2007-12-06  1:46 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: Valdis.Kletnieks, Andrew Morton, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Serge E. Hallyn wrote:
> Quoting Valdis.Kletnieks@vt.edu (Valdis.Kletnieks@vt.edu):
>> Question:
>>
>> The patch does the semantic equivalent of:
>>
>> -#define cap_clear(c)         do { cap_t(c) =  0; } while(0)
>> -#define cap_set_full(c)      do { cap_t(c) = ~0; } while(0)
>>
>> +# define cap_clear(c)         do { (c) = __cap_empty_set; } while (0)
>> +# define cap_set_full(c)      do { (c) = __cap_full_set; } while (0)
>> +# define cap_set_init_eff(c)  do { (c) = __cap_init_eff_set; } while (0)
>>
>> Was it intentional, or an oversight, that this blows chunks in modules
>> that try to use cap_clear() or cap_set_full() because the __cap_*
>> symbols don't get an EXPORT_SYMBOL() attached to them?

Definitely an oversight. Thanks Serge for the fix!

Cheers

Andrew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHV1SP+bHCR3gb8jsRAtikAJ9FEm6ETGa9qrr82kLI4ZtsACZ43gCgqIcY
GbuHBsxpaZtQDEgU/3OCgA0=
=A9+O
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-06  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-01  8:18 2.6.24-rc3-mm2 - add-64-bit-capability-support-to-the-kernel Valdis.Kletnieks
2007-12-03 15:03 ` Serge E. Hallyn
2007-12-06  1:46   ` Andrew Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).