From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: "Bruno E. O. Meneguele" <brdeoliv@redhat.com>,
linux-kernel@vger.kernel.org
Cc: linux-security-module@vger.kernel.org,
linux-integrity@vger.kernel.org, serge@hallyn.com,
james.l.morris@oracle.com, dmitry.kasatkin@gmail.com,
rusty@rustcorp.com.au, jeyu@kernel.org
Subject: Re: [PATCH v3 2/2] ima: check signature enforcement against cmdline param instead of CONFIG
Date: Tue, 24 Oct 2017 18:54:57 -0400 [thread overview]
Message-ID: <1508885697.3164.5.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <b1bab0d1184f11c06ba0484883c22bc046ffb5a6.1508865786.git.brdeoliv@redhat.com>
On Tue, 2017-10-24 at 15:37 -0200, Bruno E. O. Meneguele wrote:
> When the user requests MODULE_CHECK policy and its kernel is compiled
> with CONFIG_MODULE_SIG_FORCE not set, all modules would not load, just
> those loaded in initram time. One option the user would have would be
> set a kernel cmdline param (module.sig_enforce) to true, but the IMA
> module check code doesn't rely on this value, it checks just
> CONFIG_MODULE_SIG_FORCE.
>
> This patch solves this problem checking for the exported value of
> module.sig_enforce cmdline param intead of CONFIG_MODULE_SIG_FORCE,
> which holds the effective value (CONFIG || param).
>
> Signed-off-by: Bruno E. O. Meneguele <brdeoliv@redhat.com>
> ---
> security/integrity/ima/ima_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
> index e4ab8ef8016e..d11a7fcc5c8b 100644
> --- a/security/integrity/ima/ima_main.c
> +++ b/security/integrity/ima/ima_main.c
> @@ -356,12 +356,12 @@ void ima_post_path_mknod(struct dentry *dentry)
> */
> int ima_read_file(struct file *file, enum kernel_read_file_id read_id)
> {
> + bool sig_enforce = is_module_sig_enforced();
> +
> if (!file && read_id == READING_MODULE) {
The only reason for getting here is that you're using the old module
load syscall. Is there a reason for not using the new one, which
passes the file descriptor?
thanks,
Mimi
> -#ifndef CONFIG_MODULE_SIG_FORCE
> - if ((ima_appraise & IMA_APPRAISE_MODULES) &&
> + if (!sig_enforce && (ima_appraise & IMA_APPRAISE_MODULES) &&
> (ima_appraise & IMA_APPRAISE_ENFORCE))
> return -EACCES; /* INTEGRITY_UNKNOWN */
> -#endif
> return 0; /* We rely on module signature checking */
> }
> return 0;
WARNING: multiple messages have this Message-ID (diff)
From: zohar@linux.vnet.ibm.com (Mimi Zohar)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v3 2/2] ima: check signature enforcement against cmdline param instead of CONFIG
Date: Tue, 24 Oct 2017 18:54:57 -0400 [thread overview]
Message-ID: <1508885697.3164.5.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <b1bab0d1184f11c06ba0484883c22bc046ffb5a6.1508865786.git.brdeoliv@redhat.com>
On Tue, 2017-10-24 at 15:37 -0200, Bruno E. O. Meneguele wrote:
> When the user requests MODULE_CHECK policy and its kernel is compiled
> with CONFIG_MODULE_SIG_FORCE not set, all modules would not load, just
> those loaded in initram time. One option the user would have would be
> set a kernel cmdline param (module.sig_enforce) to true, but the IMA
> module check code doesn't rely on this value, it checks just
> CONFIG_MODULE_SIG_FORCE.
>
> This patch solves this problem checking for the exported value of
> module.sig_enforce cmdline param intead of CONFIG_MODULE_SIG_FORCE,
> which holds the effective value (CONFIG || param).
>
> Signed-off-by: Bruno E. O. Meneguele <brdeoliv@redhat.com>
> ---
> security/integrity/ima/ima_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
> index e4ab8ef8016e..d11a7fcc5c8b 100644
> --- a/security/integrity/ima/ima_main.c
> +++ b/security/integrity/ima/ima_main.c
> @@ -356,12 +356,12 @@ void ima_post_path_mknod(struct dentry *dentry)
> */
> int ima_read_file(struct file *file, enum kernel_read_file_id read_id)
> {
> + bool sig_enforce = is_module_sig_enforced();
> +
> if (!file && read_id == READING_MODULE) {
The only reason for getting here is that you're using the old module
load syscall. ?Is there a reason for not using the new one, which
passes the file descriptor?
thanks,
Mimi
> -#ifndef CONFIG_MODULE_SIG_FORCE
> - if ((ima_appraise & IMA_APPRAISE_MODULES) &&
> + if (!sig_enforce && (ima_appraise & IMA_APPRAISE_MODULES) &&
> (ima_appraise & IMA_APPRAISE_ENFORCE))
> return -EACCES; /* INTEGRITY_UNKNOWN */
> -#endif
> return 0; /* We rely on module signature checking */
> }
> return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: "Bruno E. O. Meneguele" <brdeoliv@redhat.com>,
linux-kernel@vger.kernel.org
Cc: linux-security-module@vger.kernel.org,
linux-integrity@vger.kernel.org, serge@hallyn.com,
james.l.morris@oracle.com, dmitry.kasatkin@gmail.com,
rusty@rustcorp.com.au, jeyu@kernel.org
Subject: Re: [PATCH v3 2/2] ima: check signature enforcement against cmdline param instead of CONFIG
Date: Tue, 24 Oct 2017 18:54:57 -0400 [thread overview]
Message-ID: <1508885697.3164.5.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <b1bab0d1184f11c06ba0484883c22bc046ffb5a6.1508865786.git.brdeoliv@redhat.com>
On Tue, 2017-10-24 at 15:37 -0200, Bruno E. O. Meneguele wrote:
> When the user requests MODULE_CHECK policy and its kernel is compiled
> with CONFIG_MODULE_SIG_FORCE not set, all modules would not load, just
> those loaded in initram time. One option the user would have would be
> set a kernel cmdline param (module.sig_enforce) to true, but the IMA
> module check code doesn't rely on this value, it checks just
> CONFIG_MODULE_SIG_FORCE.
>
> This patch solves this problem checking for the exported value of
> module.sig_enforce cmdline param intead of CONFIG_MODULE_SIG_FORCE,
> which holds the effective value (CONFIG || param).
>
> Signed-off-by: Bruno E. O. Meneguele <brdeoliv@redhat.com>
> ---
> security/integrity/ima/ima_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
> index e4ab8ef8016e..d11a7fcc5c8b 100644
> --- a/security/integrity/ima/ima_main.c
> +++ b/security/integrity/ima/ima_main.c
> @@ -356,12 +356,12 @@ void ima_post_path_mknod(struct dentry *dentry)
> */
> int ima_read_file(struct file *file, enum kernel_read_file_id read_id)
> {
> + bool sig_enforce = is_module_sig_enforced();
> +
> if (!file && read_id == READING_MODULE) {
The only reason for getting here is that you're using the old module
load syscall. Is there a reason for not using the new one, which
passes the file descriptor?
thanks,
Mimi
> -#ifndef CONFIG_MODULE_SIG_FORCE
> - if ((ima_appraise & IMA_APPRAISE_MODULES) &&
> + if (!sig_enforce && (ima_appraise & IMA_APPRAISE_MODULES) &&
> (ima_appraise & IMA_APPRAISE_ENFORCE))
> return -EACCES; /* INTEGRITY_UNKNOWN */
> -#endif
> return 0; /* We rely on module signature checking */
> }
> return 0;
next prev parent reply other threads:[~2017-10-24 22:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 17:36 [PATCH v3 0/2] ima: change how MODULE_SIG_FORCE is checked on modules checking policy Bruno E. O. Meneguele
2017-10-24 17:36 ` Bruno E. O. Meneguele
2017-10-24 17:37 ` [PATCH v3 1/2] module: export module signature enforcement status Bruno E. O. Meneguele
2017-10-24 17:37 ` Bruno E. O. Meneguele
2017-10-24 17:37 ` [PATCH v3 2/2] ima: check signature enforcement against cmdline param instead of CONFIG Bruno E. O. Meneguele
2017-10-24 17:37 ` Bruno E. O. Meneguele
2017-10-24 22:54 ` Mimi Zohar [this message]
2017-10-24 22:54 ` Mimi Zohar
2017-10-24 22:54 ` Mimi Zohar
2017-10-25 15:05 ` Bruno E. O. Meneguele
2017-10-25 15:05 ` Bruno E. O. Meneguele
2017-10-25 17:18 ` Mimi Zohar
2017-10-25 17:18 ` Mimi Zohar
2017-10-25 17:18 ` Mimi Zohar
2017-10-25 18:08 ` Bruno E. O. Meneguele
2017-10-25 18:08 ` Bruno E. O. Meneguele
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508885697.3164.5.camel@linux.vnet.ibm.com \
--to=zohar@linux.vnet.ibm.com \
--cc=brdeoliv@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=james.l.morris@oracle.com \
--cc=jeyu@kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.