mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] KEYS: Document making the keyring quotas controllable through /proc/sys [try #2]
@ 2008-03-14 12:05 David Howells
  2008-03-14 12:06 ` [PATCH 2/2] KEYS: Make key_serial() a function if CONFIG_KEYS=y " David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2008-03-14 12:05 UTC (permalink / raw)
  To: torvalds, akpm, kwc
  Cc: arunsr, dwalsh, linux-security-module, dhowells, linux-kernel

Alter the key management documentation to include information on keyring quota
controls as added in a previous patch.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 Documentation/keys.txt |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)


diff --git a/Documentation/keys.txt b/Documentation/keys.txt
index be424b0..d5c7a57 100644
--- a/Documentation/keys.txt
+++ b/Documentation/keys.txt
@@ -170,7 +170,8 @@ The key service provides a number of features besides keys:
      amount of description and payload space that can be consumed.
 
      The user can view information on this and other statistics through procfs
-     files.
+     files.  The root user may also alter the quota limits through sysctl files
+     (see the section "New procfs files").
 
      Process-specific and thread-specific keyrings are not counted towards a
      user's quota.
@@ -329,6 +330,27 @@ about the status of the key service:
 	<bytes>/<max>		Key size quota
 
 
+Four new sysctl files have been added also for the purpose of controlling the
+quota limits on keys:
+
+ (*) /proc/sys/kernel/keys/root_maxkeys
+     /proc/sys/kernel/keys/root_maxbytes
+
+     These files hold the maximum number of keys that root may have and the
+     maximum total number of bytes of data that root may have stored in those
+     keys.
+
+ (*) /proc/sys/kernel/keys/maxkeys
+     /proc/sys/kernel/keys/maxbytes
+
+     These files hold the maximum number of keys that each non-root user may
+     have and the maximum total number of bytes of data that each of those
+     users may have stored in their keys.
+
+Root may alter these by writing each new limit as a decimal number string to
+the appropriate file.
+
+
 ===============================
 USERSPACE SYSTEM CALL INTERFACE
 ===============================


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

* [PATCH 2/2] KEYS: Make key_serial() a function if CONFIG_KEYS=y [try #2]
  2008-03-14 12:05 [PATCH 1/2] KEYS: Document making the keyring quotas controllable through /proc/sys [try #2] David Howells
@ 2008-03-14 12:06 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2008-03-14 12:06 UTC (permalink / raw)
  To: torvalds, akpm, kwc
  Cc: arunsr, dwalsh, linux-security-module, dhowells, linux-kernel

Make key_serial() an inline function rather than a macro if CONFIG_KEYS=y.
This prevents double evaluation of the key pointer and also provides better
type checking.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/key.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/include/linux/key.h b/include/linux/key.h
index ad02d9c..c45c962 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -264,7 +264,10 @@ extern int keyring_add_key(struct key *keyring,
 
 extern struct key *key_lookup(key_serial_t id);
 
-#define key_serial(key) ((key) ? (key)->serial : 0)
+static inline key_serial_t key_serial(struct key *key)
+{
+	return key ? key->serial : 0;
+}
 
 #ifdef CONFIG_SYSCTL
 extern ctl_table key_sysctls[];


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

end of thread, other threads:[~2008-03-14 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14 12:05 [PATCH 1/2] KEYS: Document making the keyring quotas controllable through /proc/sys [try #2] David Howells
2008-03-14 12:06 ` [PATCH 2/2] KEYS: Make key_serial() a function if CONFIG_KEYS=y " David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®