[PATCH] Fix broken mlock detection

Werner Koch wk at gnupg.org
Wed Jun 16 15:58:37 CEST 2021


On Wed, 16 Jun 2021 10:07, Johannes Schindelin said:

> Which means that we are not at all detecting whether `mlock()` is
> broken.

Thanks for your correct analysis.  I wrote this test code 23 years ago
and this is the first report.  Seems that until now this has never been
tried on systems which allocate memory above 2 GiB.

> This actually happened here, in the i686 MSYS2 build of libgcrypt.

Please take care: I would not suggest to build the Windows version with
MSYS - the only supported toolchain for Windows is gcc.

> we only need the remainder modulo the page size (which is a power of
> two) anyway, it does not matter whether we clip, say, a 64-bit `size_t`
> to a 32-bit `unsigned long`. It does matter, though, whether we

Yep.  I would anyway use size_t here to avoid questions about the
reasoning.  In fact secmem.c uses uintptr_t but that is a bit too
complicated to use in this configure test.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20210616/dac2533b/attachment.sig>

More information about the Gcrypt-devel mailing list