Leftover /tmp/apt-key.* files after updates with embedded gpg keys in deb822 sources

Bug #1995247 reported by Julian Andres Klode
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Julian Andres Klode
Jammy
Fix Released
High
Julian Andres Klode
Kinetic
Won't Fix
High
Julian Andres Klode
Lunar
Fix Released
High
Julian Andres Klode

Bug Description

[Impact]
When keys are embedded into deb822 sources files as Signed-By, apt writes them to a temporary file, but the code to delete them accidentally had an if (0) in front of the deletion, so they don't get deleted and accumulate with each `apt update` run.

[Test plan]
Including a test case for this in our comprehensive integration test suite which runs as autopkgtest, so passing autopkgtest = good.

[Where problems could occur]
Files could end up being removed too soon if the code is otherwise wrong?

Changed in apt (Ubuntu Lunar):
status: New → Triaged
Changed in apt (Ubuntu Kinetic):
status: New → Triaged
Changed in apt (Ubuntu Jammy):
status: New → Triaged
Changed in apt (Ubuntu Lunar):
status: Triaged → In Progress
Changed in apt (Ubuntu Jammy):
importance: Undecided → High
Changed in apt (Ubuntu Kinetic):
importance: Undecided → High
Changed in apt (Ubuntu Lunar):
importance: Undecided → High
Changed in apt (Ubuntu Jammy):
assignee: nobody → Julian Andres Klode (juliank)
Changed in apt (Ubuntu Kinetic):
assignee: nobody → Julian Andres Klode (juliank)
Changed in apt (Ubuntu Lunar):
assignee: nobody → Julian Andres Klode (juliank)
tags: added: foundations-todo
Revision history for this message
Julian Andres Klode (juliank) wrote :

2.5.4 uploaded to unstable.

Changed in apt (Ubuntu Lunar):
status: In Progress → Fix Committed
Changed in apt (Ubuntu Kinetic):
status: Triaged → In Progress
Changed in apt (Ubuntu Jammy):
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted apt into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/2.5.3ubuntu0.1 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, what testing has been performed on the package and change the tag from verification-needed-kinetic to verification-done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-kinetic. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apt (Ubuntu Kinetic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-kinetic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (apt/2.5.3ubuntu0.1)

All autopkgtests for the newly accepted apt (2.5.3ubuntu0.1) for kinetic have finished running.
The following regressions have been reported in tests triggered by the package:

sbuild/0.83.1ubuntu1 (ppc64el, arm64, s390x, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/kinetic/update_excuses.html#apt

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

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

This bug was fixed in the package apt - 2.5.4

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

  [ David Kalnischkies ]
  * Report failures back from debSystem::AddStatusFiles
  * Avoid dealing with a fake dpkg stanza in the tests
  * Allow apt to run if no dpkg/status file exists

  [ Johannes Schauer Marin Rodrigues ]
  * since base-passwd 3.6.1 the _apt user is in the default /etc/passwd

  [ Boyuan Yang ]
  * po/zh_CN.po: Update translation for apt/2.5.3

  [ quazgar ]
  * Documentation for autopurge command

  [ Julian Andres Klode ]
  * Actually delete temporary apt-key.*.asc helper files (LP: #1995247)

 -- Julian Andres Klode <email address hidden> Mon, 31 Oct 2022 12:11:04 +0100

Changed in apt (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted apt into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/2.4.9 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, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apt (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (apt/2.4.9)

All autopkgtests for the newly accepted apt (2.4.9) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

apport/2.20.11-0ubuntu82.3 (armhf, arm64, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#apt

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

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

Marking as verified per test instructions, as the autopkgtests have all passed (and the reported regression also has been fixed in a retry apparently, hooray).

tags: added: verification-done-jammy verification-done-kinetic
removed: verification-needed-jammy verification-needed-kinetic
tags: added: verification-done
removed: verification-needed
Revision history for this message
Chris Halse Rogers (raof) wrote :

The kinetic sbuild autopkgtest regression *looks* to be a real regression to me - having a bit of a look, it seems mmdebstrap is checking the apt version against
```
$content =~ /^apt ([0-9]+\.[0-9]+\.[0-9]+)[a-z0-9]* \([a-z0-9-]+\)$/m
```
while this SRU has version string "apt 2.5.3ubuntu0.1 (amd64)". I'm not a perl expert, but I'm pretty sure that doesn't match, leaving mmdebstrap failing to detect the apt version and bailing.

It looks like this might require an mmdebstrap SRU before we can release apt?

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

FWIW, the mmdebstrap issue is resolved in lunar, I'm not sure it makes a whole lot of sense to fix kinetic to release apt 2-3 months before EOL

Revision history for this message
Chris Halse Rogers (raof) wrote :

Ok. My understanding of this bug is that it's unlikely to make anyone's system unusable, and lunar is very nearly released, so there's (very nearly) an upgrade path that preserves the fix. Marking the kinetic task as Wont Fix, and releasing to jammy.

Changed in apt (Ubuntu Kinetic):
status: Fix Committed → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.4.9

---------------
apt (2.4.9) jammy; urgency=medium

  * Actually delete temporary apt-key.*.asc helper files (LP: #1995247)

 -- Julian Andres Klode <email address hidden> Mon, 31 Oct 2022 15:18:22 +0100

Changed in apt (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package is now being 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
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (apt/2.5.3ubuntu0.1)

All autopkgtests for the newly accepted apt (2.5.3ubuntu0.1) for kinetic have finished running.
The following regressions have been reported in tests triggered by the package:

sbuild/0.83.1ubuntu1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/kinetic/update_excuses.html#apt

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Benjamin Drung (bdrung)
tags: removed: foundations-todo
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.