Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Mimi Zohar <zohar@linux.ibm.com>, dmitry.kasatkin@gmail.com
Cc: linux-integrity@vger.kernel.org, vt@altlinux.org, pvorel@suse.cz,
	stefanb@linux.ibm.com, Roberto Sassu <roberto.sassu@huawei.com>
Subject: Re: [PATCH ima-evm-utils v6] Add tests for MMAP_CHECK and MMAP_CHECK_REQPROT hooks
Date: Thu, 02 Mar 2023 18:44:01 +0100	[thread overview]
Message-ID: <7b67bc78e355d4c3541d03e1dd707f75342ca28c.camel@huaweicloud.com> (raw)
In-Reply-To: <0407924e1ad9223eed20c9cc1e3ccf685519656c.camel@linux.ibm.com>

On Thu, 2023-03-02 at 12:20 -0500, Mimi Zohar wrote:
> Hi Roberto,
> 
> > diff --git a/tests/mmap_check.test b/tests/mmap_check.test
> > new file mode 100755
> > index 00000000000..3a42fec179e
> > --- /dev/null
> > +++ b/tests/mmap_check.test
> > @@ -0,0 +1,407 @@
> > +#!/bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +#
> > +# Copyright (C) 2022-2023 Roberto Sassu <roberto.sassu@huawei.com>
> > +#
> > +# Check the behavior of MMAP_CHECK and MMAP_CHECK_REQPROT
> > +
> > +trap '_report_exit_and_cleanup _cleanup_env cleanup' SIGINT SIGTERM SIGSEGV EXIT
> > +
> > +PATCHES=(
> > +'ima: Align ima_file_mmap() parameters with mmap_file LSM hook'
> > +'ima: Introduce MMAP_CHECK_REQPROT hook'
> > +)
> > +
> > +(( ret_invalid_rule=1 ))
> > +(( ret_rule_overlap=2 ))
> > +(( ret_same_rule_exists=4 ))
> 
> New to v6 is the defintiion of these variables.   Is there a reason for
> defining them here as opposed to in check_load_ima_rule(), where they
> could be defined as local?   Here they're global and should be in upper
> case like the the variables below.  

Ok, will make them in upper case.

> > +
> > +(( EVM_INIT_HMAC=0x0001 ))
> > +(( EVM_INIT_X509=0x0002 ))
> 
> Is there a reason for initializing these variables differently than
> those below?  For example, EVM_INIT_HMAC could be define as
> EVM_INIT_HMAC=$((0x0001)).

Oh, I took them from evm.h. I can initialize those above in the same
way.

Thanks

Roberto

> +# Base VERBOSE on the environment variable, if set.
> > +VERBOSE="${VERBOSE:-0}"
> > +
> > +# Errors defined in test_mmap
> > +ERR_SETUP=1
> > +ERR_TEST=2


      reply	other threads:[~2023-03-02 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 10:08 [PATCH ima-evm-utils v6] Add tests for MMAP_CHECK and MMAP_CHECK_REQPROT hooks Roberto Sassu
2023-03-02 17:20 ` Mimi Zohar
2023-03-02 17:44   ` Roberto Sassu [this message]

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=7b67bc78e355d4c3541d03e1dd707f75342ca28c.camel@huaweicloud.com \
    --to=roberto.sassu@huaweicloud.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=roberto.sassu@huawei.com \
    --cc=stefanb@linux.ibm.com \
    --cc=vt@altlinux.org \
    --cc=zohar@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox