public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
	linux-integrity@vger.kernel.org,
	Bruno Meneguele <bmeneg@redhat.com>,
	Stefan Berger <stefanb@linux.ibm.com>
Subject: Re: [PATCH ima-evm-utils v4] evmctl: Use secure heap for private keys and passwords
Date: Mon, 13 Sep 2021 21:07:25 +0300	[thread overview]
Message-ID: <20210913180725.d4rngs22tqkgos77@altlinux.org> (raw)
In-Reply-To: <a5fce02a7ed3758c2aa13e0700b071d4b8d8213b.camel@linux.ibm.com>

Mimi,

On Mon, Sep 13, 2021 at 01:51:58PM -0400, Mimi Zohar wrote:
> > > Assuming we aren't guaranteed that the heap size is allocated, should
> > > we check (e.g. OPENSSL_secure_actual_size())?
> > 
> > We guaranteed that secure heap is allocated by return value of
> > CRYPTO_secure_malloc_init.
> > 
> > OPENSSL_secure_actual_size tell if OPENSSL_secure_malloc is actually
> > provided bigger memory fragment than we requested (to reduce
> > fragmentation). Why care about it?
> 
> We wouldn't care, assuming we're guaranteed the heap size requested was
> allocated and not the minimum heap size.  Hm, wondering what would be
> the purpose of the minimum heap size ...

Perhaps, just to control heap fragmentation.

> > > > +	if (!CRYPTO_secure_malloc_init(8192, 64))
> > > > +		log_err("CRYPTO_secure_malloc_init() failed\n");
> > > 
> > > Either change the test to "!= 1" or also log "and 2 if successful but
> > > the heap could not be protected by memory mapping."
> > 
> > Why should we care about implementation details of successful
> > allocation? If they don't think it's secure heap they should not return
> > success. And they say about its return value "and 2 if successful but",
> > so it's successful.
> 
> If you're correct, then there is no reason ever for returning 2. 
> Without documentation or digging into OpenSSL, this makes no sense to
> me.  Perhaps "secure heap" has some kernel dependency, requires HW, or
> something else entirely.  Not that there is much we could or would do,
> but simply ignoring it just seems wrong.

I looked at CRYPTO_secure_malloc_init and it seems they return 2 if
mlock/madvise is failed. I think it's major enough to report it, so I
will add it.

Thanks,


  reply	other threads:[~2021-09-13 18:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 10:50 [PATCH ima-evm-utils v4] evmctl: Use secure heap for private keys and passwords Vitaly Chikunov
2021-09-05  1:10 ` Stefan Berger
2021-09-05  8:11   ` Vitaly Chikunov
2021-09-05 11:52     ` Stefan Berger
2021-09-10 14:55 ` Mimi Zohar
2021-09-10 18:13   ` Vitaly Chikunov
2021-09-13 17:51     ` Mimi Zohar
2021-09-13 18:07       ` Vitaly Chikunov [this message]
2021-09-10 19:03   ` Mimi Zohar

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=20210913180725.d4rngs22tqkgos77@altlinux.org \
    --to=vt@altlinux.org \
    --cc=bmeneg@redhat.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.ibm.com \
    --cc=zohar@linux.vnet.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