* [PATCH 0/2] security: Constify sysctl tables
@ 2025-01-23 19:33 Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Ricardo B. Marliere @ 2025-01-23 19:33 UTC (permalink / raw)
To: Kees Cook, Paul Moore, James Morris, Serge E. Hallyn
Cc: linux-security-module, linux-kernel, Ricardo B. Marliere,
Thomas Weißschuh
Hello,
Please consider pulling these small cleanup patches. They simply add
"const" to a couple of ctl_table structs within your subsystem.
Thank you,
- Ricardo.
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
Ricardo B. Marliere (2):
yama: Make sysctl table const
LoadPin: Make sysctl table const
security/loadpin/loadpin.c | 2 +-
security/yama/yama_lsm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: a9a5e0bdc5a77a7c662ad4be0ad661f0b0d5e99d
change-id: 20250123-sysctl-kees-d7c805ee39cf
Best regards,
--
Ricardo B. Marliere <rbm@suse.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] yama: Make sysctl table const
2025-01-23 19:33 [PATCH 0/2] security: Constify sysctl tables Ricardo B. Marliere
@ 2025-01-23 19:33 ` Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-11 0:37 ` Kees Cook
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
2025-01-23 23:21 ` [PATCH 0/2] security: Constify sysctl tables Kees Cook
2 siblings, 2 replies; 11+ messages in thread
From: Ricardo B. Marliere @ 2025-01-23 19:33 UTC (permalink / raw)
To: Kees Cook, Paul Moore, James Morris, Serge E. Hallyn
Cc: linux-security-module, linux-kernel, Ricardo B. Marliere,
Thomas Weißschuh
Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
ctl_table"), the sysctl registration API allows for struct ctl_table to be
in read-only memory. Move yama_sysctl_table to be declared at build time,
instead of having to be dynamically allocated at boot time.
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
security/yama/yama_lsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index e1a5e13ea269d4917fe2c78cb79f1d44881653c2..54bd5f535ac1fef9409ea96ad60825f565318daf 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -454,7 +454,7 @@ static int yama_dointvec_minmax(const struct ctl_table *table, int write,
static int max_scope = YAMA_SCOPE_NO_ATTACH;
-static struct ctl_table yama_sysctl_table[] = {
+static const struct ctl_table yama_sysctl_table[] = {
{
.procname = "ptrace_scope",
.data = &ptrace_scope,
--
2.48.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] LoadPin: Make sysctl table const
2025-01-23 19:33 [PATCH 0/2] security: Constify sysctl tables Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
@ 2025-01-23 19:33 ` Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
` (3 more replies)
2025-01-23 23:21 ` [PATCH 0/2] security: Constify sysctl tables Kees Cook
2 siblings, 4 replies; 11+ messages in thread
From: Ricardo B. Marliere @ 2025-01-23 19:33 UTC (permalink / raw)
To: Kees Cook, Paul Moore, James Morris, Serge E. Hallyn
Cc: linux-security-module, linux-kernel, Ricardo B. Marliere,
Thomas Weißschuh
Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
ctl_table"), the sysctl registration API allows for struct ctl_table to be
in read-only memory. Move loadpin_sysctl_table to be declared at build
time, instead of having to be dynamically allocated at boot time.
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
security/loadpin/loadpin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index 68252452b66cb913638abbca2adea26219e77d37..e2d664b7602629c08c86d6d02158a4e9dd189b1a 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -53,7 +53,7 @@ static bool deny_reading_verity_digests;
#endif
#ifdef CONFIG_SYSCTL
-static struct ctl_table loadpin_sysctl_table[] = {
+static const struct ctl_table loadpin_sysctl_table[] = {
{
.procname = "enforce",
.data = &enforce,
--
2.48.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] yama: Make sysctl table const
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
@ 2025-01-23 23:20 ` Kees Cook
2025-02-11 0:37 ` Kees Cook
1 sibling, 0 replies; 11+ messages in thread
From: Kees Cook @ 2025-01-23 23:20 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Paul Moore, James Morris, Serge E. Hallyn, linux-security-module,
linux-kernel, Ricardo B. Marliere, Thomas Weißschuh
On Thu, Jan 23, 2025 at 04:33:34PM -0300, Ricardo B. Marliere wrote:
> Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
> ctl_table"), the sysctl registration API allows for struct ctl_table to be
> in read-only memory. Move yama_sysctl_table to be declared at build time,
> instead of having to be dynamically allocated at boot time.
>
> Cc: Thomas Weißschuh <linux@weissschuh.net>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] LoadPin: Make sysctl table const
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
@ 2025-01-23 23:20 ` Kees Cook
2025-02-02 11:10 ` kernel test robot
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2025-01-23 23:20 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Paul Moore, James Morris, Serge E. Hallyn, linux-security-module,
linux-kernel, Ricardo B. Marliere, Thomas Weißschuh
On Thu, Jan 23, 2025 at 04:33:35PM -0300, Ricardo B. Marliere wrote:
> Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
> ctl_table"), the sysctl registration API allows for struct ctl_table to be
> in read-only memory. Move loadpin_sysctl_table to be declared at build
> time, instead of having to be dynamically allocated at boot time.
>
> Cc: Thomas Weißschuh <linux@weissschuh.net>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] security: Constify sysctl tables
2025-01-23 19:33 [PATCH 0/2] security: Constify sysctl tables Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
@ 2025-01-23 23:21 ` Kees Cook
2025-01-24 1:02 ` Paul Moore
2 siblings, 1 reply; 11+ messages in thread
From: Kees Cook @ 2025-01-23 23:21 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Paul Moore, James Morris, Serge E. Hallyn, linux-security-module,
linux-kernel, Ricardo B. Marliere, Thomas Weißschuh
On Thu, Jan 23, 2025 at 04:33:33PM -0300, Ricardo B. Marliere wrote:
> Please consider pulling these small cleanup patches. They simply add
> "const" to a couple of ctl_table structs within your subsystem.
Paul, do you want to take these, or should I put them in my tree?
-Kees
--
Kees Cook
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] security: Constify sysctl tables
2025-01-23 23:21 ` [PATCH 0/2] security: Constify sysctl tables Kees Cook
@ 2025-01-24 1:02 ` Paul Moore
0 siblings, 0 replies; 11+ messages in thread
From: Paul Moore @ 2025-01-24 1:02 UTC (permalink / raw)
To: Kees Cook
Cc: Ricardo B. Marliere, James Morris, Serge E. Hallyn,
linux-security-module, linux-kernel, Ricardo B. Marliere,
Thomas Weißschuh
On Thu, Jan 23, 2025 at 6:21 PM Kees Cook <kees@kernel.org> wrote:
> On Thu, Jan 23, 2025 at 04:33:33PM -0300, Ricardo B. Marliere wrote:
> > Please consider pulling these small cleanup patches. They simply add
> > "const" to a couple of ctl_table structs within your subsystem.
>
> Paul, do you want to take these, or should I put them in my tree?
Since you maintain both Yama and LoadPin and these patches are fully
contained within those LSMs I kinda figured you would grab them for
their respective trees. However, if you would prefer for me to take
them via the LSM tree I can do that, just let me know.
You can also feel free to add my review tag to both patches if you want.
Reviewed-by: Paul Moore <paul@paul-moore.com>
--
paul-moore.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] LoadPin: Make sysctl table const
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
@ 2025-02-02 11:10 ` kernel test robot
2025-02-11 0:38 ` Kees Cook
2025-02-14 15:54 ` kernel test robot
3 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-02-02 11:10 UTC (permalink / raw)
To: Ricardo B. Marliere, Kees Cook, Paul Moore, James Morris,
Serge E. Hallyn
Cc: llvm, oe-kbuild-all, linux-security-module, linux-kernel,
Ricardo B. Marliere, Thomas Weißschuh
Hi Ricardo,
kernel test robot noticed the following build errors:
[auto build test ERROR on a9a5e0bdc5a77a7c662ad4be0ad661f0b0d5e99d]
url: https://github.com/intel-lab-lkp/linux/commits/Ricardo-B-Marliere/yama-Make-sysctl-table-const/20250124-033808
base: a9a5e0bdc5a77a7c662ad4be0ad661f0b0d5e99d
patch link: https://lore.kernel.org/r/20250123-sysctl-kees-v1-2-533359e74d66%40suse.com
patch subject: [PATCH 2/2] LoadPin: Make sysctl table const
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250202/202502021853.d0nqHvPc-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250202/202502021853.d0nqHvPc-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502021853.d0nqHvPc-lkp@intel.com/
All errors (new ones prefixed by >>):
>> security/loadpin/loadpin.c:75:34: error: cannot assign to variable 'loadpin_sysctl_table' with const-qualified type 'const struct ctl_table[1]'
75 | loadpin_sysctl_table[0].extra1 = SYSCTL_ZERO;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
security/loadpin/loadpin.c:56:31: note: variable 'loadpin_sysctl_table' declared const here
56 | static const struct ctl_table loadpin_sysctl_table[] = {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
57 | {
| ~
58 | .procname = "enforce",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 | .data = &enforce,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | .maxlen = sizeof(int),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 | .mode = 0644,
| ~~~~~~~~~~~~~~~~~~~~~~~
62 | .proc_handler = proc_dointvec_minmax,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 | .extra1 = SYSCTL_ONE,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 | .extra2 = SYSCTL_ONE,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65 | },
| ~~
66 | };
| ~
security/loadpin/loadpin.c:77:34: error: cannot assign to variable 'loadpin_sysctl_table' with const-qualified type 'const struct ctl_table[1]'
77 | loadpin_sysctl_table[0].extra1 = SYSCTL_ONE;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
security/loadpin/loadpin.c:56:31: note: variable 'loadpin_sysctl_table' declared const here
56 | static const struct ctl_table loadpin_sysctl_table[] = {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
57 | {
| ~
58 | .procname = "enforce",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 | .data = &enforce,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | .maxlen = sizeof(int),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 | .mode = 0644,
| ~~~~~~~~~~~~~~~~~~~~~~~
62 | .proc_handler = proc_dointvec_minmax,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 | .extra1 = SYSCTL_ONE,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 | .extra2 = SYSCTL_ONE,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65 | },
| ~~
66 | };
| ~
2 errors generated.
vim +75 security/loadpin/loadpin.c
9b091556a073a9 Kees Cook 2016-04-20 67
60ba1028fc7b73 Kees Cook 2022-12-09 68 static void set_sysctl(bool is_writable)
9b091556a073a9 Kees Cook 2016-04-20 69 {
9b091556a073a9 Kees Cook 2016-04-20 70 /*
9b091556a073a9 Kees Cook 2016-04-20 71 * If load pinning is not enforced via a read-only block
9b091556a073a9 Kees Cook 2016-04-20 72 * device, allow sysctl to change modes for testing.
9b091556a073a9 Kees Cook 2016-04-20 73 */
60ba1028fc7b73 Kees Cook 2022-12-09 74 if (is_writable)
60ba1028fc7b73 Kees Cook 2022-12-09 @75 loadpin_sysctl_table[0].extra1 = SYSCTL_ZERO;
60ba1028fc7b73 Kees Cook 2022-12-09 76 else
60ba1028fc7b73 Kees Cook 2022-12-09 77 loadpin_sysctl_table[0].extra1 = SYSCTL_ONE;
60ba1028fc7b73 Kees Cook 2022-12-09 78 }
60ba1028fc7b73 Kees Cook 2022-12-09 79 #else
60ba1028fc7b73 Kees Cook 2022-12-09 80 static inline void set_sysctl(bool is_writable) { }
60ba1028fc7b73 Kees Cook 2022-12-09 81 #endif
60ba1028fc7b73 Kees Cook 2022-12-09 82
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] yama: Make sysctl table const
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
@ 2025-02-11 0:37 ` Kees Cook
1 sibling, 0 replies; 11+ messages in thread
From: Kees Cook @ 2025-02-11 0:37 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Paul Moore, James Morris, Serge E. Hallyn, linux-security-module,
linux-kernel, Ricardo B. Marliere, Thomas Weißschuh
On Thu, Jan 23, 2025 at 04:33:34PM -0300, Ricardo B. Marliere wrote:
> Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
> ctl_table"), the sysctl registration API allows for struct ctl_table to be
> in read-only memory. Move yama_sysctl_table to be declared at build time,
> instead of having to be dynamically allocated at boot time.
>
> Cc: Thomas Weißschuh <linux@weissschuh.net>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
> ---
> security/yama/yama_lsm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
> index e1a5e13ea269d4917fe2c78cb79f1d44881653c2..54bd5f535ac1fef9409ea96ad60825f565318daf 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -454,7 +454,7 @@ static int yama_dointvec_minmax(const struct ctl_table *table, int write,
>
> static int max_scope = YAMA_SCOPE_NO_ATTACH;
>
> -static struct ctl_table yama_sysctl_table[] = {
> +static const struct ctl_table yama_sysctl_table[] = {
This was done via commit 1751f872cc97 ("treewide: const qualify
ctl_tables where applicable").
--
Kees Cook
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] LoadPin: Make sysctl table const
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-02 11:10 ` kernel test robot
@ 2025-02-11 0:38 ` Kees Cook
2025-02-14 15:54 ` kernel test robot
3 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2025-02-11 0:38 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Paul Moore, James Morris, Serge E. Hallyn, linux-security-module,
linux-kernel, Ricardo B. Marliere, Thomas Weißschuh
On Thu, Jan 23, 2025 at 04:33:35PM -0300, Ricardo B. Marliere wrote:
> Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
> ctl_table"), the sysctl registration API allows for struct ctl_table to be
> in read-only memory. Move loadpin_sysctl_table to be declared at build
> time, instead of having to be dynamically allocated at boot time.
>
> Cc: Thomas Weißschuh <linux@weissschuh.net>
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
> ---
> security/loadpin/loadpin.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
> index 68252452b66cb913638abbca2adea26219e77d37..e2d664b7602629c08c86d6d02158a4e9dd189b1a 100644
> --- a/security/loadpin/loadpin.c
> +++ b/security/loadpin/loadpin.c
> @@ -53,7 +53,7 @@ static bool deny_reading_verity_digests;
> #endif
>
> #ifdef CONFIG_SYSCTL
> -static struct ctl_table loadpin_sysctl_table[] = {
> +static const struct ctl_table loadpin_sysctl_table[] = {
> {
> .procname = "enforce",
> .data = &enforce,
This can't be done since the table is modified during set_sysctl().
-Kees
--
Kees Cook
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] LoadPin: Make sysctl table const
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
` (2 preceding siblings ...)
2025-02-11 0:38 ` Kees Cook
@ 2025-02-14 15:54 ` kernel test robot
3 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-02-14 15:54 UTC (permalink / raw)
To: Ricardo B. Marliere, Kees Cook, Paul Moore, James Morris,
Serge E. Hallyn
Cc: oe-kbuild-all, linux-security-module, linux-kernel,
Ricardo B. Marliere, Thomas Weißschuh
Hi Ricardo,
kernel test robot noticed the following build errors:
[auto build test ERROR on a9a5e0bdc5a77a7c662ad4be0ad661f0b0d5e99d]
url: https://github.com/intel-lab-lkp/linux/commits/Ricardo-B-Marliere/yama-Make-sysctl-table-const/20250124-033808
base: a9a5e0bdc5a77a7c662ad4be0ad661f0b0d5e99d
patch link: https://lore.kernel.org/r/20250123-sysctl-kees-v1-2-533359e74d66%40suse.com
patch subject: [PATCH 2/2] LoadPin: Make sysctl table const
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20250214/202502142320.sf6WGiJs-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250214/202502142320.sf6WGiJs-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502142320.sf6WGiJs-lkp@intel.com/
All errors (new ones prefixed by >>):
security/loadpin/loadpin.c: In function 'set_sysctl':
>> security/loadpin/loadpin.c:75:48: error: assignment of member 'extra1' in read-only object
75 | loadpin_sysctl_table[0].extra1 = SYSCTL_ZERO;
| ^
security/loadpin/loadpin.c:77:48: error: assignment of member 'extra1' in read-only object
77 | loadpin_sysctl_table[0].extra1 = SYSCTL_ONE;
| ^
vim +/extra1 +75 security/loadpin/loadpin.c
9b091556a073a9 Kees Cook 2016-04-20 67
60ba1028fc7b73 Kees Cook 2022-12-09 68 static void set_sysctl(bool is_writable)
9b091556a073a9 Kees Cook 2016-04-20 69 {
9b091556a073a9 Kees Cook 2016-04-20 70 /*
9b091556a073a9 Kees Cook 2016-04-20 71 * If load pinning is not enforced via a read-only block
9b091556a073a9 Kees Cook 2016-04-20 72 * device, allow sysctl to change modes for testing.
9b091556a073a9 Kees Cook 2016-04-20 73 */
60ba1028fc7b73 Kees Cook 2022-12-09 74 if (is_writable)
60ba1028fc7b73 Kees Cook 2022-12-09 @75 loadpin_sysctl_table[0].extra1 = SYSCTL_ZERO;
60ba1028fc7b73 Kees Cook 2022-12-09 76 else
60ba1028fc7b73 Kees Cook 2022-12-09 77 loadpin_sysctl_table[0].extra1 = SYSCTL_ONE;
60ba1028fc7b73 Kees Cook 2022-12-09 78 }
60ba1028fc7b73 Kees Cook 2022-12-09 79 #else
60ba1028fc7b73 Kees Cook 2022-12-09 80 static inline void set_sysctl(bool is_writable) { }
60ba1028fc7b73 Kees Cook 2022-12-09 81 #endif
60ba1028fc7b73 Kees Cook 2022-12-09 82
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-02-14 15:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-23 19:33 [PATCH 0/2] security: Constify sysctl tables Ricardo B. Marliere
2025-01-23 19:33 ` [PATCH 1/2] yama: Make sysctl table const Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-11 0:37 ` Kees Cook
2025-01-23 19:33 ` [PATCH 2/2] LoadPin: " Ricardo B. Marliere
2025-01-23 23:20 ` Kees Cook
2025-02-02 11:10 ` kernel test robot
2025-02-11 0:38 ` Kees Cook
2025-02-14 15:54 ` kernel test robot
2025-01-23 23:21 ` [PATCH 0/2] security: Constify sysctl tables Kees Cook
2025-01-24 1:02 ` Paul Moore
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).