apt-key adv should gpgconf --kill all the things after execution

Bug #1773992 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Julian Andres Klode
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
dirmngr processes are left hanging around after doing key server stuff with apt-key adv.

[Test case]
apt-key adv --recv-keys "8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092" < /dev/null ; sleep 2; ps aux

should not show a dirmngr process (except for any that was there before running it, obviously).

[Regression potential]
This just kills more processes using the temporary gpg home directory. It's hard to imagine what could go wrong there. Maybe gpgconf could go mad and kill the wrong process, who knows?

[Original bug report]
apt-key adv should gpgconf --kill all the things after execution

to ensure that e.g. dirmngr processes are not left hanging around

Revision history for this message
Julian Andres Klode (juliank) wrote :

So, we should do gpgconf --kill for everything and not just for gpg-agent? Hmm. Sounds like a job for a for loop.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

yeah, everything. As these commands may spawn dirmngr and gpg-agent which can linger around.

Changed in apt (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Julian Andres Klode (juliank)
Changed in apt (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.7.0~alpha0ubuntu2

---------------
apt (1.7.0~alpha0ubuntu2) cosmic; urgency=medium

  [ David Kalnischkies ]
  * Add boilerplate plural form to po/apt-all.pot
  * don't try SRV requests based on IP addresses
  * use 127.0.0.1 instead of localhost as default Tor proxy
  * Extend apt build-dep pkg/release to switch dep as needed
  * Support release selector for volatile files as well
  * Start pkg records for deb files with dpkg output
  * Deprectate buggy/incorrect Rls/PkgFile::IsOk methods
  * Support --with-source in show & search commands
  * Support local files as arguments in show command (Closes: 883206)
  * Drop alternative URIs we got a hash-based fail from
  * Handle by-hash URI construction more centrally
  * Don't force the same mirror for by-hash URIs
  * Reword error for timed out read/write on SOCKS proxy (Closes: #898886)
  * Don't show acquire warning for "hidden" components (Closes: #879591)
  * Use a steady clock source for progress reporting
  * Use steady clock source for bandwidth limitation

  [ Filipe Brandenburger ]
  * Update .gitignore
  * Increase debug verbosity in `apt-get autoremove`
  * Extend test-apt-get-autoremove to check debug output

  [ Julian Andres Klode ]
  * tests: Do not expect requested-by if sudo was invoked by root
  * Run tests on GitLab CI
  * Handle a missed case of timed out ip addresses (LP: #1766542)
  * Lower default timeout from 120s to 30s
  * apt-key: Pass all instead of gpg-agent to gpgconf --kill (LP: #1773992)
  * Fix lock counting in debSystem

  [ annadane ]
  * Add verb 'be' to NEWS entry for 1.5~beta1 (Closes: 892792)

  [ Алексей Шилин ]
  * Russian program translation update (Closes: 898797)

  [ Frans Spiesschaert ]
  * Dutch program translation update (Closes: #900589)
  * Dutch manpage translation update (Closes: #900602)

 -- Julian Andres Klode <email address hidden> Tue, 19 Jun 2018 17:12:51 +0200

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
Changed in apt (Ubuntu Bionic):
status: New → In Progress
status: In Progress → Triaged
description: updated
description: updated
description: updated
Changed in apt (Ubuntu Bionic):
status: Triaged → In Progress
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Dimitri, or anyone else affected,

Accepted apt into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/1.6.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apt (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Julian Andres Klode (juliank) wrote :
Download full text (4.4 KiB)

Verified. The first dirmngr started by 1.6.1 stayed alive even after 1.6.2 finished executing; the dirmngr started by 1.6.2 was not alive anymore.

+ lxc launch -e ubuntu:bionic lp1773992-bionic
Creating lp1773992-bionic
Starting lp1773992-bionic
+ sleep 5
+ lxc exec lp1773992-bionic -- sh -c 'apt-cache policy apt | grep Inst ; apt-key adv --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092 < /dev/null ; sleep 2; ps aux'
  Installed: 1.6.1
Executing: /tmp/apt-key-gpghome.UEzrZXm31Q/gpg.1.sh --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092
[...]
root 326 0.0 0.0 173060 13952 ? Ss 09:39 0:00 dirmngr --daemon --homedir /tmp/apt-key-gpghome.UEzrZXm31Q
root 411 0.0 0.0 37792 3428 ? R+ 09:40 0:00 ps aux
+ lxc exec lp1773992-bionic -- sh -c 'echo deb http://archive.ubuntu.com/ubuntu bionic-proposed main >> /etc/apt/sources.list && apt-get update && apt-get -y install apt/bionic-proposed'
dpkg-preconfigure: unable to re-open stdin: No such file or directory
+ lxc exec lp1773992-bionic -- sh -c 'apt-cache policy apt | grep Inst ; apt-key adv --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092 < /dev/null ; sleep 2; ps aux'
  Installed: 1.6.2
Executing: /tmp/apt-key-gpghome.EAd3H1TKh1/gpg.1.sh --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092
gpg: key D94AA3F0EFE21092: 45 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: "Ubuntu CD Image Automatic Signing Key (2012) <email address hidden>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 159664 8980 ? Ss 09:39 0:00 /sbin/init
root 51 0.0 0.0 78436 9844 ? Ss 09:39 0:00 /lib/systemd/systemd-journald
root 63 0.0 0.0 33348 3580 ? Ss 09:39 0:00 /lib/systemd/systemd-udevd
systemd+ 151 0.0 0.0 80012 5340 ? Ss 09:39 0:00 /lib/systemd/systemd-networkd
systemd+ 152 0.0 0.0 70608 5332 ? Ss 09:39 0:00 /lib/systemd/systemd-resolved
daemon 189 0.0 0.0 28332 2404 ? Ss 09:39 0:00 /usr/sbin/atd -f
root 191 0.0 0.0 31748 3180 ? Ss 09:39 0:00 /usr/sbin/cron -f
root 192 0.0 0.0 287988 7072 ? Ssl 09:39 0:00 /usr/lib/accountsservice/accounts-daemon
root 194 0.0 0.0 61996 5736 ? Ss 09:39 0:00 /lib/systemd/systemd-logind
syslog 196 0.0 0.0 197636 4336 ? Ssl 09:39 0:00 /usr/sbin/rsyslogd -n
root 197 0.0 0.0 1434880 21332 ? Ssl 09:39 0:00 /usr/lib/snapd/snapd
r...

Read more...

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.6.2

---------------
apt (1.6.2) unstable; urgency=medium

  * Fix build with new gtest (Closes: #897149)
  * Handle a missed case of timed out ip addresses (LP: #1766542)
  * Lower default network timeouts from 120s to 30s
  * apt-key: Pass all instead of gpg-agent to gpgconf --kill (LP: #1773992)
  * Fix lock counting in debSystem (LP: #1778547)
  * CI fixes:
   - tests: Do not expect requested-by if sudo was invoked by root
   - Run tests on GitLab CI
   - CI: Export DEBIAN_FRONTEND=noninteractive in all CI environments

 -- Julian Andres Klode <email address hidden> Mon, 25 Jun 2018 17:15:10 +0200

Changed in apt (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.