Page MenuHome GnuPG

npth resource locking not working on AIX
Closed, ResolvedPublic

Description

On AIX sem_init with parameter pshared=0 creates semaphore inaccessible by child
process. This breaks gpg-agent.

Workaround is fall back to sem_open, allready implemented in library.

Please see atteched patch for npth master with configure test for sem_init
capability.

Tested on powerpc AIX 5.3, 7.1.

More details here:
https://lists.gnupg.org/pipermail/gnupg-devel/2016-February/030812.html

Details

Version
1.2

Related Objects

Event Timeline

Thank you.
I think that it's better to use sem_init with pshared=1.
I'm sending my proposal patch to gnupg-devel.

pshared=1 will not work on AIX for FORKED processes. It works only for threads.

Sorry, I might be wrong about in previous comment. I am not sure if pshareds=1
opens up some vulnerability hole.

uldis: Thanks for your comment. Let me show my opinion.
There are three ways (at least) to create a semaphore.
Each has different semantics, how it can be shared among different processes.

(1) sem_init with pshared=0: Not shared among processes
(2) sem_init with pshared=1: Shared among children processes of particular parent
(3) sem_open: Shared among any processes (with relevant permission)

For AIX, npth doesn't work well with (1). You suggested (3), while I proposed (2).
It is true that (2) and (3) would open up some attack vector(s),
but I believe that (2) is smaller, if any.