[4/5] IMA: use obj-y for non-modular objects
diff mbox series

Message ID 20190726021058.4212-5-yamada.masahiro@socionext.com
State New
Headers show
Series
  • security: integrity: Makefile cleanups
Related show

Commit Message

Masahiro Yamada July 26, 2019, 2:10 a.m. UTC
CONFIG_IMA is a boolean option, so none of these objects is linked
into a module.

All the objects in this directory are compiled only when CONFIG_IMA=y
since this directory is guarded by the parent Makefile:

  obj-$(CONFIG_IMA)                       += ima/

So, there is no point in creating the composite object, ima.o

Flatten the code into the obj-$(CONFIG_...) form.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 security/integrity/ima/Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Eric Biggers July 26, 2019, 4:37 a.m. UTC | #1
On Fri, Jul 26, 2019 at 11:10:57AM +0900, Masahiro Yamada wrote:
> CONFIG_IMA is a boolean option, so none of these objects is linked
> into a module.
> 
> All the objects in this directory are compiled only when CONFIG_IMA=y
> since this directory is guarded by the parent Makefile:
> 
>   obj-$(CONFIG_IMA)                       += ima/
> 
> So, there is no point in creating the composite object, ima.o
> 
> Flatten the code into the obj-$(CONFIG_...) form.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  security/integrity/ima/Makefile | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/security/integrity/ima/Makefile b/security/integrity/ima/Makefile
> index d921dc4f9eb0..5517486c9154 100644
> --- a/security/integrity/ima/Makefile
> +++ b/security/integrity/ima/Makefile
> @@ -4,10 +4,8 @@
>  # Measurement Architecture(IMA).
>  #
>  
> -obj-$(CONFIG_IMA) += ima.o
> -
> -ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
> +obj-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
>  	 ima_policy.o ima_template.o ima_template_lib.o
> -ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
> -ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
> +obj-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
> +obj-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
>  obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
> -- 

This patch changes the kernel command line options

	ima.ahash_minsize
	ima.ahash_bufsize

to
	ima_crypto.ahash_minsize
	ima_crypto.ahash_bufsize

Intentional?

Note that these are documented in
Documentation/admin-guide/kernel-parameters.txt.

- Eric
Masahiro Yamada July 26, 2019, 7:04 a.m. UTC | #2
On Fri, Jul 26, 2019 at 1:37 PM Eric Biggers <ebiggers@kernel.org> wrote:
>
> On Fri, Jul 26, 2019 at 11:10:57AM +0900, Masahiro Yamada wrote:
> > CONFIG_IMA is a boolean option, so none of these objects is linked
> > into a module.
> >
> > All the objects in this directory are compiled only when CONFIG_IMA=y
> > since this directory is guarded by the parent Makefile:
> >
> >   obj-$(CONFIG_IMA)                       += ima/
> >
> > So, there is no point in creating the composite object, ima.o
> >
> > Flatten the code into the obj-$(CONFIG_...) form.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  security/integrity/ima/Makefile | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/security/integrity/ima/Makefile b/security/integrity/ima/Makefile
> > index d921dc4f9eb0..5517486c9154 100644
> > --- a/security/integrity/ima/Makefile
> > +++ b/security/integrity/ima/Makefile
> > @@ -4,10 +4,8 @@
> >  # Measurement Architecture(IMA).
> >  #
> >
> > -obj-$(CONFIG_IMA) += ima.o
> > -
> > -ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
> > +obj-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
> >        ima_policy.o ima_template.o ima_template_lib.o
> > -ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
> > -ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
> > +obj-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
> > +obj-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
> >  obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
> > --
>
> This patch changes the kernel command line options
>
>         ima.ahash_minsize
>         ima.ahash_bufsize
>
> to
>         ima_crypto.ahash_minsize
>         ima_crypto.ahash_bufsize
>
> Intentional?

No.
I missed those kernel parameters.
So, please drop this patch.

I see no problem in 3/5, 5/5, but
if composite object is preferred for consistency,
please feel free to drop them as well.

Thanks.




> Note that these are documented in
> Documentation/admin-guide/kernel-parameters.txt.

Patch
diff mbox series

diff --git a/security/integrity/ima/Makefile b/security/integrity/ima/Makefile
index d921dc4f9eb0..5517486c9154 100644
--- a/security/integrity/ima/Makefile
+++ b/security/integrity/ima/Makefile
@@ -4,10 +4,8 @@ 
 # Measurement Architecture(IMA).
 #
 
-obj-$(CONFIG_IMA) += ima.o
-
-ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
+obj-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
 	 ima_policy.o ima_template.o ima_template_lib.o
-ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
-ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
+obj-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
+obj-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
 obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o