* [PATCH 1/5] integrity: remove unneeded, broken attempt to add -fshort-wchar
2019-07-26 2:10 [PATCH 0/5] security: integrity: Makefile cleanups Masahiro Yamada
@ 2019-07-26 2:10 ` Masahiro Yamada
2019-09-09 11:43 ` Masahiro Yamada
2019-07-26 2:10 ` [PATCH 2/5] integrity: remove pointless subdir-$(CONFIG_...) Masahiro Yamada
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 2:10 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Masahiro Yamada, Dave Howells, James Morris, Josh Boyer,
Martin Schwidefsky, Nayna Jain, Serge E. Hallyn, linux-kernel,
linux-security-module
I guess commit 15ea0e1e3e18 ("efi: Import certificates from UEFI Secure
Boot") attempted to add -fshort-wchar for building load_uefi.o, but it
has never worked as intended.
load_uefi.o is created in the platform_certs/ sub-directory. If you
really want to add -fshort-wchar, the correct code is:
$(obj)/platform_certs/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar
or, in a more Kbuild-ish way:
CFLAGS_load_uefi.o := -fshort-wchar
But, you do not need to fix it.
Commit 8c97023cf051 ("Kbuild: use -fshort-wchar globally") had already
added -fshort-wchar globally. This code was unneeded in the first place.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
security/integrity/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/security/integrity/Makefile b/security/integrity/Makefile
index 19faace69644..b6d6273a4176 100644
--- a/security/integrity/Makefile
+++ b/security/integrity/Makefile
@@ -13,7 +13,6 @@ integrity-$(CONFIG_INTEGRITY_PLATFORM_KEYRING) += platform_certs/platform_keyrin
integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
platform_certs/load_uefi.o
integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
-$(obj)/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar
subdir-$(CONFIG_IMA) += ima
obj-$(CONFIG_IMA) += ima/
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] integrity: remove unneeded, broken attempt to add -fshort-wchar
2019-07-26 2:10 ` [PATCH 1/5] integrity: remove unneeded, broken attempt to add -fshort-wchar Masahiro Yamada
@ 2019-09-09 11:43 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-09-09 11:43 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Dave Howells, James Morris, Josh Boyer, Martin Schwidefsky,
Nayna Jain, Serge E. Hallyn, Linux Kernel Mailing List,
linux-security-module
On Fri, Jul 26, 2019 at 11:11 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> I guess commit 15ea0e1e3e18 ("efi: Import certificates from UEFI Secure
> Boot") attempted to add -fshort-wchar for building load_uefi.o, but it
> has never worked as intended.
>
> load_uefi.o is created in the platform_certs/ sub-directory. If you
> really want to add -fshort-wchar, the correct code is:
>
> $(obj)/platform_certs/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar
>
> or, in a more Kbuild-ish way:
>
> CFLAGS_load_uefi.o := -fshort-wchar
>
> But, you do not need to fix it.
>
> Commit 8c97023cf051 ("Kbuild: use -fshort-wchar globally") had already
> added -fshort-wchar globally. This code was unneeded in the first place.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
Ping.
>
> security/integrity/Makefile | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/security/integrity/Makefile b/security/integrity/Makefile
> index 19faace69644..b6d6273a4176 100644
> --- a/security/integrity/Makefile
> +++ b/security/integrity/Makefile
> @@ -13,7 +13,6 @@ integrity-$(CONFIG_INTEGRITY_PLATFORM_KEYRING) += platform_certs/platform_keyrin
> integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
> platform_certs/load_uefi.o
> integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
> -$(obj)/load_uefi.o: KBUILD_CFLAGS += -fshort-wchar
>
> subdir-$(CONFIG_IMA) += ima
> obj-$(CONFIG_IMA) += ima/
> --
> 2.17.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/5] integrity: remove pointless subdir-$(CONFIG_...)
2019-07-26 2:10 [PATCH 0/5] security: integrity: Makefile cleanups Masahiro Yamada
2019-07-26 2:10 ` [PATCH 1/5] integrity: remove unneeded, broken attempt to add -fshort-wchar Masahiro Yamada
@ 2019-07-26 2:10 ` Masahiro Yamada
2019-09-09 11:44 ` Masahiro Yamada
2019-07-26 2:10 ` [PATCH 3/5] integrity: use obj-y for non-modular objects Masahiro Yamada
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 2:10 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Masahiro Yamada, Dave Howells, James Morris, Josh Boyer,
Martin Schwidefsky, Nayna Jain, Serge E. Hallyn, linux-kernel,
linux-security-module
The ima/ and evm/ sub-directories contain built-in objects, so
obj-$(CONFIG_...) is the correct way to descend into them.
subdir-$(CONFIG_...) is redundant.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
security/integrity/Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/security/integrity/Makefile b/security/integrity/Makefile
index b6d6273a4176..35e6ca773734 100644
--- a/security/integrity/Makefile
+++ b/security/integrity/Makefile
@@ -14,7 +14,5 @@ integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
platform_certs/load_uefi.o
integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
-subdir-$(CONFIG_IMA) += ima
obj-$(CONFIG_IMA) += ima/
-subdir-$(CONFIG_EVM) += evm
obj-$(CONFIG_EVM) += evm/
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] integrity: remove pointless subdir-$(CONFIG_...)
2019-07-26 2:10 ` [PATCH 2/5] integrity: remove pointless subdir-$(CONFIG_...) Masahiro Yamada
@ 2019-09-09 11:44 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-09-09 11:44 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Dave Howells, James Morris, Josh Boyer, Martin Schwidefsky,
Nayna Jain, Serge E. Hallyn, Linux Kernel Mailing List,
linux-security-module
On Fri, Jul 26, 2019 at 11:12 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> The ima/ and evm/ sub-directories contain built-in objects, so
> obj-$(CONFIG_...) is the correct way to descend into them.
>
> subdir-$(CONFIG_...) is redundant.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
Ping.
>
> security/integrity/Makefile | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/security/integrity/Makefile b/security/integrity/Makefile
> index b6d6273a4176..35e6ca773734 100644
> --- a/security/integrity/Makefile
> +++ b/security/integrity/Makefile
> @@ -14,7 +14,5 @@ integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
> platform_certs/load_uefi.o
> integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
>
> -subdir-$(CONFIG_IMA) += ima
> obj-$(CONFIG_IMA) += ima/
> -subdir-$(CONFIG_EVM) += evm
> obj-$(CONFIG_EVM) += evm/
> --
> 2.17.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/5] integrity: use obj-y for non-modular objects
2019-07-26 2:10 [PATCH 0/5] security: integrity: Makefile cleanups Masahiro Yamada
2019-07-26 2:10 ` [PATCH 1/5] integrity: remove unneeded, broken attempt to add -fshort-wchar Masahiro Yamada
2019-07-26 2:10 ` [PATCH 2/5] integrity: remove pointless subdir-$(CONFIG_...) Masahiro Yamada
@ 2019-07-26 2:10 ` Masahiro Yamada
2019-07-26 2:10 ` [PATCH 4/5] IMA: " Masahiro Yamada
2019-07-26 2:10 ` [PATCH 5/5] EVM: " Masahiro Yamada
4 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 2:10 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Masahiro Yamada, Dave Howells, James Morris, Josh Boyer,
Martin Schwidefsky, Nayna Jain, Serge E. Hallyn, linux-kernel,
linux-security-module
CONFIG_INTEGRITY is a boolean option, so none of these objects is
linked into a module.
All of the other CONFIG options here depend on CONFIG_INTEGRITY,
so there is no point in creating the composite object, integirity.o
Flatten the code into the obj-$(CONFIG_...) form.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
security/integrity/Makefile | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/security/integrity/Makefile b/security/integrity/Makefile
index 35e6ca773734..53bb1d70e631 100644
--- a/security/integrity/Makefile
+++ b/security/integrity/Makefile
@@ -3,16 +3,14 @@
# Makefile for caching inode integrity data (iint)
#
-obj-$(CONFIG_INTEGRITY) += integrity.o
-
-integrity-y := iint.o
-integrity-$(CONFIG_INTEGRITY_AUDIT) += integrity_audit.o
-integrity-$(CONFIG_INTEGRITY_SIGNATURE) += digsig.o
-integrity-$(CONFIG_INTEGRITY_ASYMMETRIC_KEYS) += digsig_asymmetric.o
-integrity-$(CONFIG_INTEGRITY_PLATFORM_KEYRING) += platform_certs/platform_keyring.o
-integrity-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
+obj-$(CONFIG_INTEGRITY) += iint.o
+obj-$(CONFIG_INTEGRITY_AUDIT) += integrity_audit.o
+obj-$(CONFIG_INTEGRITY_SIGNATURE) += digsig.o
+obj-$(CONFIG_INTEGRITY_ASYMMETRIC_KEYS) += digsig_asymmetric.o
+obj-$(CONFIG_INTEGRITY_PLATFORM_KEYRING) += platform_certs/platform_keyring.o
+obj-$(CONFIG_LOAD_UEFI_KEYS) += platform_certs/efi_parser.o \
platform_certs/load_uefi.o
-integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
+obj-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o
obj-$(CONFIG_IMA) += ima/
obj-$(CONFIG_EVM) += evm/
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] IMA: use obj-y for non-modular objects
2019-07-26 2:10 [PATCH 0/5] security: integrity: Makefile cleanups Masahiro Yamada
` (2 preceding siblings ...)
2019-07-26 2:10 ` [PATCH 3/5] integrity: use obj-y for non-modular objects Masahiro Yamada
@ 2019-07-26 2:10 ` Masahiro Yamada
2019-07-26 4:37 ` Eric Biggers
2019-07-26 2:10 ` [PATCH 5/5] EVM: " Masahiro Yamada
4 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 2:10 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Masahiro Yamada, Dmitry Kasatkin, James Morris, Serge E. Hallyn,
linux-kernel, linux-security-module
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
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] IMA: use obj-y for non-modular objects
2019-07-26 2:10 ` [PATCH 4/5] IMA: " Masahiro Yamada
@ 2019-07-26 4:37 ` Eric Biggers
2019-07-26 7:04 ` Masahiro Yamada
0 siblings, 1 reply; 10+ messages in thread
From: Eric Biggers @ 2019-07-26 4:37 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Mimi Zohar, linux-integrity, Dmitry Kasatkin, James Morris,
Serge E. Hallyn, linux-kernel, linux-security-module
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] IMA: use obj-y for non-modular objects
2019-07-26 4:37 ` Eric Biggers
@ 2019-07-26 7:04 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 7:04 UTC (permalink / raw)
To: Masahiro Yamada, Mimi Zohar, linux-integrity, Dmitry Kasatkin,
James Morris, Serge E. Hallyn, Linux Kernel Mailing List,
linux-security-module
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.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 5/5] EVM: use obj-y for non-modular objects
2019-07-26 2:10 [PATCH 0/5] security: integrity: Makefile cleanups Masahiro Yamada
` (3 preceding siblings ...)
2019-07-26 2:10 ` [PATCH 4/5] IMA: " Masahiro Yamada
@ 2019-07-26 2:10 ` Masahiro Yamada
4 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-07-26 2:10 UTC (permalink / raw)
To: Mimi Zohar, linux-integrity
Cc: Masahiro Yamada, James Morris, Serge E. Hallyn, linux-kernel,
linux-security-module
CONFIG_EVM 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_EVM=y
since this directory is guarded by the parent Makefile:
obj-$(CONFIG_EVM) += evm/
So, there is no point in creating the composite object, evm.o
Flatten the code into the obj-$(CONFIG_...) form.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
security/integrity/evm/Makefile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/security/integrity/evm/Makefile b/security/integrity/evm/Makefile
index a56f5613be79..ace8e4ef5a96 100644
--- a/security/integrity/evm/Makefile
+++ b/security/integrity/evm/Makefile
@@ -2,7 +2,5 @@
#
# Makefile for building the Extended Verification Module(EVM)
#
-obj-$(CONFIG_EVM) += evm.o
-
-evm-y := evm_main.o evm_crypto.o evm_secfs.o
-evm-$(CONFIG_FS_POSIX_ACL) += evm_posix_acl.o
+obj-y := evm_main.o evm_crypto.o evm_secfs.o
+obj-$(CONFIG_FS_POSIX_ACL) += evm_posix_acl.o
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread