blob: b46b651b3c4cc65bcb0409e9a3e3c1e74604ac9d [file] [log] [blame]
Thomas Gleixnerb4d0d232019-05-20 19:08:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
David Howells0b77f5b2008-04-29 01:01:32 -07002/* Key management controls
3 *
4 * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
David Howells0b77f5b2008-04-29 01:01:32 -07006 */
7
8#include <linux/key.h>
9#include <linux/sysctl.h>
10#include "internal.h"
11
Joe Perchesfab71a92014-04-13 18:55:51 -070012struct ctl_table key_sysctls[] = {
David Howells0b77f5b2008-04-29 01:01:32 -070013 {
David Howells0b77f5b2008-04-29 01:01:32 -070014 .procname = "maxkeys",
15 .data = &key_quota_maxkeys,
16 .maxlen = sizeof(unsigned),
17 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080018 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070019 .extra1 = (void *) SYSCTL_ONE,
20 .extra2 = (void *) SYSCTL_INT_MAX,
David Howells0b77f5b2008-04-29 01:01:32 -070021 },
22 {
David Howells0b77f5b2008-04-29 01:01:32 -070023 .procname = "maxbytes",
24 .data = &key_quota_maxbytes,
25 .maxlen = sizeof(unsigned),
26 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080027 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070028 .extra1 = (void *) SYSCTL_ONE,
29 .extra2 = (void *) SYSCTL_INT_MAX,
David Howells0b77f5b2008-04-29 01:01:32 -070030 },
31 {
David Howells0b77f5b2008-04-29 01:01:32 -070032 .procname = "root_maxkeys",
33 .data = &key_quota_root_maxkeys,
34 .maxlen = sizeof(unsigned),
35 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080036 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070037 .extra1 = (void *) SYSCTL_ONE,
38 .extra2 = (void *) SYSCTL_INT_MAX,
David Howells0b77f5b2008-04-29 01:01:32 -070039 },
40 {
David Howells0b77f5b2008-04-29 01:01:32 -070041 .procname = "root_maxbytes",
42 .data = &key_quota_root_maxbytes,
43 .maxlen = sizeof(unsigned),
44 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080045 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070046 .extra1 = (void *) SYSCTL_ONE,
47 .extra2 = (void *) SYSCTL_INT_MAX,
David Howells5d135442009-09-02 09:14:00 +010048 },
49 {
David Howells5d135442009-09-02 09:14:00 +010050 .procname = "gc_delay",
51 .data = &key_gc_delay,
52 .maxlen = sizeof(unsigned),
53 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080054 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070055 .extra1 = (void *) SYSCTL_ZERO,
56 .extra2 = (void *) SYSCTL_INT_MAX,
David Howells0b77f5b2008-04-29 01:01:32 -070057 },
David Howellsf36f8c72013-09-24 10:35:19 +010058#ifdef CONFIG_PERSISTENT_KEYRINGS
59 {
60 .procname = "persistent_keyring_expiry",
61 .data = &persistent_keyring_expiry,
62 .maxlen = sizeof(unsigned),
63 .mode = 0644,
64 .proc_handler = proc_dointvec_minmax,
Matteo Croceeec48442019-07-18 15:58:50 -070065 .extra1 = (void *) SYSCTL_ZERO,
66 .extra2 = (void *) SYSCTL_INT_MAX,
David Howellsf36f8c72013-09-24 10:35:19 +010067 },
68#endif
Eric W. Biederman5cdb3552009-04-03 05:08:03 -070069 { }
David Howells0b77f5b2008-04-29 01:01:32 -070070};