From: Milan Broz <gmazyland@gmail.com>
To: Belisko Marek <marek.belisko@gmail.com>,
Milan Broz <gmazyland@gmail.com>,
"dm-crypt@saout.de" <dm-crypt@saout.de>,
Peter Rajnoha <prajnoha@redhat.com>,
agk@redhat.com
Subject: Re: [dm-crypt] cryptsetup problem with memory allocation
Date: Fri, 04 Jul 2014 18:44:10 +0200 [thread overview]
Message-ID: <53B6D9DA.1010406@gmail.com> (raw)
In-Reply-To: <CAAfyv37wghkv9-5AZkg9YyNEs2bbs+V5xNZ0YtKawd3NF9Nj8w@mail.gmail.com>
On 07/04/2014 05:02 PM, Belisko Marek wrote:
> Hi,
>
> On Tue, Jun 24, 2014 at 1:12 AM, Alasdair G Kergon <agk@redhat.com> wrote:
>>>> I track it down that malloc fails (ENONMEM) in libdevmapper and then
>>>> _dm_check_versions() fails when creating dm task (dmt =
>>>> dm_task_create(DM_DEVICE_LIST_VERSIONS).
>>
>> After updating to the most recent version you are able to use,
>> run it under strace and let us see the relevant output (at least the
>> failing system call itself, what leads up to it, including all early
>> memory-related system calls and DM ioctls) and any environment variables
>> set that could modify behaviour.
> when update to latest cryptsetup (1.64) I can see different error as with 1.62:
> ioctl(6, DM_VERSION, 0x1e340) = -1 EACCES (Permission denied)
> So it seems that gcrypt probably drop privileges (as running on
> embedded system I'm root)?
Just guess, but do you have gcrypt compiled with Posix capabilities?
If so, it cannot work. See this comment in cryptsetup gcrypt wrapper
(you can workaround it by uncommenting this #if and rebuild cryptsetup)
lib/crypto_backend/crypto_gcrypt.c:
/* FIXME: If gcrypt compiled to support POSIX 1003.1e capabilities,
* it drops all privileges during secure memory initialisation.
* For now, the only workaround is to disable secure memory in gcrypt.
* cryptsetup always need at least cap_sys_admin privilege for dm-ioctl
* and it locks its memory space anyway.
*/
#if 0
gcry_control (GCRYCTL_DISABLE_SECMEM);
crypto_backend_secmem = 0;
#else
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
#endif
Milan
next prev parent reply other threads:[~2014-07-04 16:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 8:50 [dm-crypt] cryptsetup problem with memory allocation Belisko Marek
2014-06-23 9:01 ` .. ink ..
2014-06-23 9:05 ` Belisko Marek
2014-06-23 12:31 ` Belisko Marek
2014-06-23 21:45 ` Milan Broz
2014-06-23 23:12 ` Alasdair G Kergon
2014-07-04 15:02 ` Belisko Marek
2014-07-04 16:44 ` Milan Broz [this message]
2014-07-08 6:22 ` Belisko Marek
2014-06-23 23:17 ` Alasdair G Kergon
2014-07-04 14:44 ` Belisko Marek
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=53B6D9DA.1010406@gmail.com \
--to=gmazyland@gmail.com \
--cc=agk@redhat.com \
--cc=dm-crypt@saout.de \
--cc=marek.belisko@gmail.com \
--cc=prajnoha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.