* [kernel-hardening] [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init
@ 2017-02-13 5:34 James Morris
2017-02-14 1:45 ` [kernel-hardening] " Mimi Zohar
0 siblings, 1 reply; 4+ messages in thread
From: James Morris @ 2017-02-13 5:34 UTC (permalink / raw)
To: linux-security-module; +Cc: kernel-hardening, Mimi Zohar
The default IMA rules are loaded during init and then do not
change, so mark them as __ro_after_init.
Signed-off-by: James Morris <james.l.morris@oracle.com>
---
security/integrity/ima/ima_policy.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index aed47b7..e8498a3 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -83,7 +83,7 @@ struct ima_rule_entry {
* normal users can easily run the machine out of memory simply building
* and running executables.
*/
-static struct ima_rule_entry dont_measure_rules[] = {
+static struct ima_rule_entry dont_measure_rules[] __ro_after_init = {
{.action = DONT_MEASURE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC},
{.action = DONT_MEASURE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC},
{.action = DONT_MEASURE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC},
@@ -97,7 +97,7 @@ struct ima_rule_entry {
{.action = DONT_MEASURE, .fsmagic = NSFS_MAGIC, .flags = IMA_FSMAGIC}
};
-static struct ima_rule_entry original_measurement_rules[] = {
+static struct ima_rule_entry original_measurement_rules[] __ro_after_init = {
{.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC,
.flags = IMA_FUNC | IMA_MASK},
{.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC,
@@ -108,7 +108,7 @@ struct ima_rule_entry {
{.action = MEASURE, .func = FIRMWARE_CHECK, .flags = IMA_FUNC},
};
-static struct ima_rule_entry default_measurement_rules[] = {
+static struct ima_rule_entry default_measurement_rules[] __ro_after_init = {
{.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC,
.flags = IMA_FUNC | IMA_MASK},
{.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC,
@@ -122,7 +122,7 @@ struct ima_rule_entry {
{.action = MEASURE, .func = POLICY_CHECK, .flags = IMA_FUNC},
};
-static struct ima_rule_entry default_appraise_rules[] = {
+static struct ima_rule_entry default_appraise_rules[] __ro_after_init = {
{.action = DONT_APPRAISE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC},
{.action = DONT_APPRAISE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC},
{.action = DONT_APPRAISE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC},
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [kernel-hardening] Re: [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init
2017-02-13 5:34 [kernel-hardening] [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init James Morris
@ 2017-02-14 1:45 ` Mimi Zohar
2017-02-14 10:38 ` James Morris
0 siblings, 1 reply; 4+ messages in thread
From: Mimi Zohar @ 2017-02-14 1:45 UTC (permalink / raw)
To: James Morris; +Cc: linux-security-module, kernel-hardening
On Mon, 2017-02-13 at 16:34 +1100, James Morris wrote:
> The default IMA rules are loaded during init and then do not
> change, so mark them as __ro_after_init.
>
> Signed-off-by: James Morris <james.l.morris@oracle.com>
Thanks!
Mimi
> ---
> security/integrity/ima/ima_policy.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index aed47b7..e8498a3 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -83,7 +83,7 @@ struct ima_rule_entry {
> * normal users can easily run the machine out of memory simply building
> * and running executables.
> */
> -static struct ima_rule_entry dont_measure_rules[] = {
> +static struct ima_rule_entry dont_measure_rules[] __ro_after_init = {
> {.action = DONT_MEASURE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC},
> {.action = DONT_MEASURE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC},
> {.action = DONT_MEASURE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC},
> @@ -97,7 +97,7 @@ struct ima_rule_entry {
> {.action = DONT_MEASURE, .fsmagic = NSFS_MAGIC, .flags = IMA_FSMAGIC}
> };
>
> -static struct ima_rule_entry original_measurement_rules[] = {
> +static struct ima_rule_entry original_measurement_rules[] __ro_after_init = {
> {.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC,
> .flags = IMA_FUNC | IMA_MASK},
> {.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC,
> @@ -108,7 +108,7 @@ struct ima_rule_entry {
> {.action = MEASURE, .func = FIRMWARE_CHECK, .flags = IMA_FUNC},
> };
>
> -static struct ima_rule_entry default_measurement_rules[] = {
> +static struct ima_rule_entry default_measurement_rules[] __ro_after_init = {
> {.action = MEASURE, .func = MMAP_CHECK, .mask = MAY_EXEC,
> .flags = IMA_FUNC | IMA_MASK},
> {.action = MEASURE, .func = BPRM_CHECK, .mask = MAY_EXEC,
> @@ -122,7 +122,7 @@ struct ima_rule_entry {
> {.action = MEASURE, .func = POLICY_CHECK, .flags = IMA_FUNC},
> };
>
> -static struct ima_rule_entry default_appraise_rules[] = {
> +static struct ima_rule_entry default_appraise_rules[] __ro_after_init = {
> {.action = DONT_APPRAISE, .fsmagic = PROC_SUPER_MAGIC, .flags = IMA_FSMAGIC},
> {.action = DONT_APPRAISE, .fsmagic = SYSFS_MAGIC, .flags = IMA_FSMAGIC},
> {.action = DONT_APPRAISE, .fsmagic = DEBUGFS_MAGIC, .flags = IMA_FSMAGIC},
^ permalink raw reply [flat|nested] 4+ messages in thread
* [kernel-hardening] Re: [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init
2017-02-14 1:45 ` [kernel-hardening] " Mimi Zohar
@ 2017-02-14 10:38 ` James Morris
2017-02-15 5:58 ` Mimi Zohar
0 siblings, 1 reply; 4+ messages in thread
From: James Morris @ 2017-02-14 10:38 UTC (permalink / raw)
To: Mimi Zohar; +Cc: linux-security-module, kernel-hardening
On Mon, 13 Feb 2017, Mimi Zohar wrote:
> On Mon, 2017-02-13 at 16:34 +1100, James Morris wrote:
> > The default IMA rules are loaded during init and then do not
> > change, so mark them as __ro_after_init.
> >
> > Signed-off-by: James Morris <james.l.morris@oracle.com>
>
> Thanks!
Is that an acked-by?
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [kernel-hardening] Re: [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init
2017-02-14 10:38 ` James Morris
@ 2017-02-15 5:58 ` Mimi Zohar
0 siblings, 0 replies; 4+ messages in thread
From: Mimi Zohar @ 2017-02-15 5:58 UTC (permalink / raw)
To: James Morris; +Cc: linux-security-module, kernel-hardening
On Tue, 2017-02-14 at 21:38 +1100, James Morris wrote:
> On Mon, 13 Feb 2017, Mimi Zohar wrote:
>
> > On Mon, 2017-02-13 at 16:34 +1100, James Morris wrote:
> > > The default IMA rules are loaded during init and then do not
> > > change, so mark them as __ro_after_init.
> > >
> > > Signed-off-by: James Morris <james.l.morris@oracle.com>
> >
> > Thanks!
>
> Is that an acked-by?
Yes, thanks.
Mimi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-15 5:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13 5:34 [kernel-hardening] [RFC PATCH 3/4] integrity: mark default IMA rules as __ro_after_init James Morris
2017-02-14 1:45 ` [kernel-hardening] " Mimi Zohar
2017-02-14 10:38 ` James Morris
2017-02-15 5:58 ` Mimi Zohar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.