Home GnuPG

Improve handling of mlock error codes.
618b8978f46fUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Improve handling of mlock error codes.

* acinclude.m4 (GNUPG_CHECK_MLOCK): Check also for EAGAIN which is a
legitimate return code and does not indicate a broken mlock().
* src/secmem.c (lock_pool_pages): Test ERR instead of ERRNO which
could have been overwritten by cap_from+text et al.
On FreeBSD, if there are not enough free pages, mlock() can return
EAGAIN, as documented in mlock(2). That doesn't mean that mlock is
broken. I suspect this same issue also exists on the other BSD's.

This is (now) also true for Linux.

  • Suggested-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Dec 9 2016, 12:10 PM
Parents
rC656395ba4cf3: random: Eliminate unneeded memcpy invocations in the DRBG.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rC618b8978f46f: Improve handling of mlock error codes. (authored by Werner Koch <wk@gnupg.org>).Dec 9 2016, 12:10 PM