Re: How to estimate the upper bound of the peak memory consumption of cryptsetup itself?

Milan Broz <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 16/06/2022 06:43, Coiby Xu wrote:
> Hi,
> 
> Recently, I notice cryptsetup itself consumes significant amount of
> memory (~256M) when estimating the memory requirement for dumping vmcore
> to a LUKS-encrypted disk,
> 
> $ time -v cryptsetup luksOpen encrypted.img volume --key-file mykey.keyfile | grep "Maximum resident set size"
>           Maximum resident set size (kbytes): 1309828
> $ cryptsetup luksDump encrypted.img
> ...
> Keyslots:
>     0: luks2
>           PBKDF:      argon2id
>           Memory:     1048576
>           ...
> 
> 
> So is there a way to estimate the upper bound of the peak memory
> consumption of cryptsetup itself without running cryptsetup?

As you already found, the major memory consumption is by memory-hard KDF.
But this memory is used only while calculating keyslot encryption key,
it is released immediately after the Argon call is finished.
I do not think we have better estimation here.

(Another story is locking all memory, including big areas used by libc,
but that should not be problem here, I hope.)

Milan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.