All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ima: change how MODULE_SIG_FORCE is checked on modules checking policy
@ 2017-10-24 17:36 ` Bruno E. O. Meneguele
  0 siblings, 0 replies; 16+ messages in thread
From: Bruno E. O. Meneguele @ 2017-10-24 17:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-security-module, linux-integrity, serge, james.l.morris,
	dmitry.kasatkin, zohar, rusty, jeyu

This patchset ensure that IMA's modules checking policy:

    measure func=MODULE_CHECK uid=0

rely on the correct value of CONFIG_MODULE_SIG_FORCE, since the way it
is today the code completely ignores the module.sig_enforce cmdline
param, which behaves in a OR logic with the CONFIG value
(CONFIG_MODULE_SIG_FORCE || module.sig_enforce). That said, everytime a
module would load, in the current checking code, when the kernel was not
compiled with the CONFIG set the call to init_module syscall fails with
-EACCES:

# strace -f -v modprobe <any-module> | grep init_module
init_module(0x55b9bcc9bba0, 17763, "") = -1 EACCES (Permission denied)

With this patchset the result would rely on the module.sig_enforce
cmdline as well. Once the CONFIG is not set, but the param is, the
result would be 'success', as it should be:

# strace -f -v modprobe <any-module> | grep init_module
init_module(0x7f9602d6e010, 386646, "") = 0

The patchset was tested in two different kernels: 4.13.6 (Fedora 27) and
4.14.0-rc4 (integrity-next tree).

Changes:
    v3: 
        1/2 - added dummy is_module_sig_enforced() function to the case
        where CONFIG_MODULES is not set and IMA=y.
    v2:
        1/2 - code changes to correct checkpatch.pl warnings.

Bruno E. O. Meneguele (2):
  module: export module signature enforcement status
  ima: check signature enforcement against cmdline param instead of
    CONFIG

 include/linux/module.h            |  7 +++++++
 kernel/module.c                   | 10 ++++++++++
 security/integrity/ima/ima_main.c |  6 +++---
 3 files changed, 20 insertions(+), 3 deletions(-)

-- 
2.13.6

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

end of thread, other threads:[~2017-10-25 18:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.