diff mbox

[USER,2/2] Add security.apparmor to the set of extended attributes used by EVM

Message ID 20180417225601.6965-2-mjg59@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Garrett April 17, 2018, 10:56 p.m. UTC
The kernel is taking security.apparmor into account when validating EVM,
so evmctl should be doing the same.

Signed-off-by: Matthew Garrett <mjg59@google.com>
---
 src/evmctl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mimi Zohar June 12, 2018, 11:42 p.m. UTC | #1
On Tue, 2018-04-17 at 15:56 -0700, Matthew Garrett wrote:
> The kernel is taking security.apparmor into account when validating EVM,
> so evmctl should be doing the same.
> 
> Signed-off-by: Matthew Garrett <mjg59@google.com>

The XATTR_NAME_APPARMOR is dependent on the version of
"/usr/include/linux/xattr.h".  Without it defined, evmctl fails to
build.

Mimi

> ---
>  src/evmctl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/evmctl.c b/src/evmctl.c
> index 43d261f..e350f69 100644
> --- a/src/evmctl.c
> +++ b/src/evmctl.c
> @@ -69,6 +69,7 @@
>  static char *evm_default_xattrs[] = {
>  	XATTR_NAME_SELINUX,
>  	XATTR_NAME_SMACK,
> +	XATTR_NAME_APPARMOR,
>  	XATTR_NAME_IMA,
>  	XATTR_NAME_CAPS,
>  	NULL
> @@ -80,6 +81,7 @@ static char *evm_extra_smack_xattrs[] = {
>  	XATTR_NAME_SMACKEXEC,
>  	XATTR_NAME_SMACKTRANSMUTE,
>  	XATTR_NAME_SMACKMMAP,
> +	XATTR_NAME_APPARMOR,
>  	XATTR_NAME_IMA,
>  	XATTR_NAME_CAPS,
>  	NULL
Matthew Garrett June 14, 2018, 7:43 p.m. UTC | #2
On Tue, Jun 12, 2018 at 4:42 PM Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
>
> On Tue, 2018-04-17 at 15:56 -0700, Matthew Garrett wrote:
> > The kernel is taking security.apparmor into account when validating EVM,
> > so evmctl should be doing the same.
> >
> > Signed-off-by: Matthew Garrett <mjg59@google.com>
>
> The XATTR_NAME_APPARMOR is dependent on the version of
> "/usr/include/linux/xattr.h".  Without it defined, evmctl fails to
> build.

Hmm, true. Is it reasonable to just hardcode it rather than using the define?
Mimi Zohar June 14, 2018, 8:41 p.m. UTC | #3
On Thu, 2018-06-14 at 12:43 -0700, Matthew Garrett wrote:
> On Tue, Jun 12, 2018 at 4:42 PM Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
> >
> > On Tue, 2018-04-17 at 15:56 -0700, Matthew Garrett wrote:
> > > The kernel is taking security.apparmor into account when validating EVM,
> > > so evmctl should be doing the same.
> > >
> > > Signed-off-by: Matthew Garrett <mjg59@google.com>
> >
> > The XATTR_NAME_APPARMOR is dependent on the version of
> > "/usr/include/linux/xattr.h".  Without it defined, evmctl fails to
> > build.
> 
> Hmm, true. Is it reasonable to just hardcode it rather than using the define?

I'm not sure how difficult it would be to tie the package name/version
to a specific kernel release.  Commit 096b85464832 ("EVM: Include
security.apparmor in EVM measurements") was upstreamed in linux-4.15.

Mimi
Mimi Zohar July 1, 2018, 8:28 p.m. UTC | #4
On Thu, 2018-06-14 at 16:41 -0400, Mimi Zohar wrote:
> On Thu, 2018-06-14 at 12:43 -0700, Matthew Garrett wrote:
> > On Tue, Jun 12, 2018 at 4:42 PM Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
> > >
> > > On Tue, 2018-04-17 at 15:56 -0700, Matthew Garrett wrote:
> > > > The kernel is taking security.apparmor into account when validating EVM,
> > > > so evmctl should be doing the same.
> > > >
> > > > Signed-off-by: Matthew Garrett <mjg59@google.com>
> > >
> > > The XATTR_NAME_APPARMOR is dependent on the version of
> > > "/usr/include/linux/xattr.h".  Without it defined, evmctl fails to
> > > build.
> > 
> > Hmm, true. Is it reasonable to just hardcode it rather than using the define?
> 
> I'm not sure how difficult it would be to tie the package name/version
> to a specific kernel release.  Commit 096b85464832 ("EVM: Include
> security.apparmor in EVM measurements") was upstreamed in linux-4.15.

Instead, I've made the following change and pushed it out to master.

+#ifndef XATTR_APPAARMOR_SUFFIX
+#define XATTR_APPARMOR_SUFFIX "apparmor"
+#define XATTR_NAME_APPARMOR XATTR_SECURITY_PREFIX XATTR_APPARMOR_SUFFIX
+#endif
+

thanks,

Mimi
diff mbox

Patch

diff --git a/src/evmctl.c b/src/evmctl.c
index 43d261f..e350f69 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
@@ -69,6 +69,7 @@ 
 static char *evm_default_xattrs[] = {
 	XATTR_NAME_SELINUX,
 	XATTR_NAME_SMACK,
+	XATTR_NAME_APPARMOR,
 	XATTR_NAME_IMA,
 	XATTR_NAME_CAPS,
 	NULL
@@ -80,6 +81,7 @@  static char *evm_extra_smack_xattrs[] = {
 	XATTR_NAME_SMACKEXEC,
 	XATTR_NAME_SMACKTRANSMUTE,
 	XATTR_NAME_SMACKMMAP,
+	XATTR_NAME_APPARMOR,
 	XATTR_NAME_IMA,
 	XATTR_NAME_CAPS,
 	NULL