linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Stefan Berger <stefanb@linux.ibm.com>,
	zohar@linux.ibm.com, dmitry.kasatkin@gmail.com,
	jmorris@namei.org, serge@hallyn.com
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	Roberto Sassu <roberto.sassu@huawei.com>
Subject: Re: [PATCH ima-evm-utils] Add tests for MMAP_CHECK and MMAP_CHECK_REQPROT hooks
Date: Fri, 27 Jan 2023 08:57:17 +0100	[thread overview]
Message-ID: <36d25da9b9b6aa004311e083a67bc44f3edcf05c.camel@huaweicloud.com> (raw)
In-Reply-To: <5a2b46ef-71de-03f5-3d4d-ef6834a33971@linux.ibm.com>

On Thu, 2023-01-26 at 17:25 -0500, Stefan Berger wrote:
> 
> On 1/26/23 11:38, Roberto Sassu wrote:
> > From: Roberto Sassu <roberto.sassu@huawei.com>
> > 
> > Add tests to ensure that, after applying the kernel patch 'ima: Align
> > ima_file_mmap() parameters with mmap_file LSM hook', the MMAP_CHECK hook
> > checks the protections applied by the kernel and not those requested by the
> > application.
> > 
> > Also ensure that after applying 'ima: Introduce MMAP_CHECK_REQPROT hook',
> > the MMAP_CHECK_REQPROT hook checks the protections requested by the
> > application.
> 
> below LGTM
> 
> How do you tell the user that the patches need to be applied for the test to
> succeed and not worry about it when the patches are not applied?

Uhm, I agree. I should at least write a comment as for EVM portable
signatures, and maybe display a message in the test logs.

> > Test both with the test_mmap application that by default requests the
> > PROT_READ protection flag. Its syntax is:
> > 
> > +
> > +check_mmap() {
> > +	local hook="$1"
> > +	local arg="$2"
> > +	local test_file
> > +	local fowner
> > +	local rule
> > +	local result
> > +	local test_file_entry
> > +
> 
> you can write them all in one line: 'local test_file fowner rule result test_file_entry'

Ok.

Thanks

Roberto


  reply	other threads:[~2023-01-27  7:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 16:38 [PATCH v3 1/2] ima: Align ima_file_mmap() parameters with mmap_file LSM hook Roberto Sassu
2023-01-26 16:38 ` [PATCH v3 2/2] ima: Introduce MMAP_CHECK_REQPROT hook Roberto Sassu
2023-01-29 14:52   ` Mimi Zohar
2023-01-30 10:37     ` Roberto Sassu
2023-01-26 16:38 ` [PATCH ima-evm-utils] Add tests for MMAP_CHECK and MMAP_CHECK_REQPROT hooks Roberto Sassu
2023-01-26 22:25   ` Stefan Berger
2023-01-27  7:57     ` Roberto Sassu [this message]
2023-01-26 19:37 ` [PATCH v3 1/2] ima: Align ima_file_mmap() parameters with mmap_file LSM hook Stefan Berger
2023-01-27  7:55   ` Roberto Sassu

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=36d25da9b9b6aa004311e083a67bc44f3edcf05c.camel@huaweicloud.com \
    --to=roberto.sassu@huaweicloud.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=serge@hallyn.com \
    --cc=stefanb@linux.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).