Home GnuPG

Improve handling of mlock error codes.
d6f84f4fc592Unpublished

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
rC008fd9291754: random: Eliminate unneeded memcpy invocations in the DRBG.
Branches
Unknown
Tags
Unknown

Event Timeline

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