[pkg-gnupg-maint] Bug#1092628: pinentry-gtk2: Gets stuck in a loop and prevents other pinentry from running if the terminal is closed when reading from terminal

Tim Connors reportbug at rather.puzzling.org
Fri Jan 10 06:14:45 GMT 2025


Package: pinentry-gtk2
Version: 1.2.1-1
Severity: normal

Anything invoking this copy of pinentry (haven't verified the other
pinentry packages), if closed prematurely before a password is
accepted or rejected from the terminal, results in further invocations
being blocked for a long time (I've seen indefinitely).

For example:

> unset DISPLAY
> gpg --batch --decrypt --quiet test.gpg

This invokes the following process tree:

: 55783,20; ps axuf | grep -A2 -B2 -e [p]inentry -e [g]pg
...
tconnors   51704  0.0  0.0 499120  3224 ?        SLsl  2024   0:46  \_ /usr/bin/gpg-agent --supervised
tconnors  786820  0.8  0.0 251912 11564 ?        SLl  17:04   0:00  |   \_ pinentry
...
tconnors  786818  0.0  0.0  11288  4924 pts/337  SL+  17:04   0:00          |                           |       \_ gpg --batch --decrypt --quiet /home/tconnors/ntt/master.gpg

...

Now if I kill `gpg --batch ...`, then pinentry just spins:

tconnors   51704  0.0  0.0 499120  3224 ?        SLsl  2024   0:46  \_ /usr/bin/gpg-agent --supervised
tconnors  786820 63.2  0.0 251912 11564 ?        RLl  17:04   0:03  |   \_ pinentry

[pid 786820] gettimeofday({tv_sec=1736489157, tv_usec=122208}, NULL) = 0
[pid 786820] poll([{fd=10, events=POLLIN}], 1, 70) = 1 ([{fd=10, revents=POLLIN|POLLERR|POLLHUP}])
[pid 786820] gettimeofday({tv_sec=1736489157, tv_usec=122614}, NULL) = 0
[pid 786820] read(10, "", 1)            = 0
[pid 786820] gettimeofday({tv_sec=1736489157, tv_usec=123033}, NULL) = 0
[pid 786820] poll([{fd=10, events=POLLIN}], 1, 70) = 1 ([{fd=10, revents=POLLIN|POLLERR|POLLHUP}])
[pid 786820] gettimeofday({tv_sec=1736489157, tv_usec=123542}, NULL) = 0

One guesses that pinentry ignores SIGPIPE and/or errors and/or EOF
from the read system call.  Even though it's primarily trying to be an
X11 display, it still allows fallback to terminal, so it should cope
correctly when the terminal does terminal things.


-- System Information:
Debian Release: 12.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable'), (5, 'testing'), (2, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.10.11+bpo-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pinentry-gtk2 depends on:
ii  libassuan0     2.5.5-5
ii  libc6          2.36-9+deb12u9
ii  libglib2.0-0   2.74.6-2+deb12u4
ii  libgpg-error0  1.46-1
ii  libgtk2.0-0    2.24.33-2+deb12u1
ii  libncursesw6   6.4-4
ii  libsecret-1-0  0.20.5-3
ii  libtinfo6      6.4-4

pinentry-gtk2 recommends no packages.

Versions of packages pinentry-gtk2 suggests:
pn  pinentry-doc  <none>

-- no debconf information



More information about the pkg-gnupg-maint mailing list