<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg, branch 1.7.0</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=1.7.0</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=1.7.0'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2018-10-05T10:45:47Z</updated>
<entry>
<title>Set DPKG_FRONTEND_LOCKED when running {pre,post}-invoke scripts</title>
<updated>2018-10-05T10:45:47Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2018-10-05T10:29:39Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=6675601c81de85b40dc89772c1d6d17f1811c5ba'/>
<id>urn:sha1:6675601c81de85b40dc89772c1d6d17f1811c5ba</id>
<content type='text'>
Some post-invoke scripts install packages, which fails because
the environment variable is not set. This sets the variable for
all three kinds of scripts {pre,post-}invoke and pre-install-pkgs,
but we will only allow post-invoke at a later time.

Gbp-Dch: full
</content>
</entry>
<entry>
<title>pkgCacheFile: Only unlock in destructor if locked before</title>
<updated>2018-09-24T10:13:03Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2018-09-24T09:38:55Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=e02297b8e22dae04872fe6fab6dba966de65dbba'/>
<id>urn:sha1:e02297b8e22dae04872fe6fab6dba966de65dbba</id>
<content type='text'>
pkgCacheFile's destructor unlocks the system, which is confusing
if you did not open the cachefile with WithLock set. Create a private
data instance that holds the value of WithLock.

This regression was introduced in commit b2e465d6d32d2dc884f58b94acb7e35f671a87fe:

    Join with aliencode
    Author: jgg
    Date: 2001-02-20 07:03:16 GMT
    Join with aliencode

by replacing a "Lock" member that was only initialized when the lock
was taken by calls to Lock, UnLock; with the latter also taking place
if the former did not occur.

Regression-Of: b2e465d6d32d2dc884f58b94acb7e35f671a87fe
LP: #1794053
</content>
</entry>
<entry>
<title>Fix calculation of elapsed usec in downloads</title>
<updated>2018-09-24T07:27:01Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2018-09-24T07:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=089e627153781ae7c320a5a0724c6c70d684b689'/>
<id>urn:sha1:089e627153781ae7c320a5a0724c6c70d684b689</id>
<content type='text'>
A recent change to use chronos inadvertently replaced the
difference of new usec - old usec with new sec - old usec,
which is obviously wrong.
</content>
</entry>
<entry>
<title>Reorder progress report messages</title>
<updated>2018-09-11T11:08:58Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-09-10T19:34:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=329c8d5e149465003ea9007661a7af1099c75c43'/>
<id>urn:sha1:329c8d5e149465003ea9007661a7af1099c75c43</id>
<content type='text'>
We are seeing 'processing' messages from dpkg first, so it makes sense
to translate them to "Preparing" messages instead of using "Installing"
and co to override these shortly after with the "Preparing" messages.

The difference isn't all to visible as later messages tend to linger far
longer in the display than the ealier ones, but at least in a listing it
seems more logical.
</content>
</entry>
<entry>
<title>Don't expect duplicated dpkg status-fd messages</title>
<updated>2018-09-11T11:08:58Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-09-10T16:43:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=f484906eff85c8c9eadc13ce817d8857abdd08e8'/>
<id>urn:sha1:f484906eff85c8c9eadc13ce817d8857abdd08e8</id>
<content type='text'>
The progress reporting relies on parsing the status reports of
dpkg which used to repeat being in the same state multiple times
in the same run, but by fixing #365921 it will stop doing so.

The problem is in theory just with 'config-files' in case we do purge as
this (can) do remove + purge in one step, but we remove this also for
the unpack + configure combination althrough we handle these currently
in two independent dpkg calls.
</content>
</entry>
<entry>
<title>Process status-fd completely before finishing dpkg call</title>
<updated>2018-09-11T11:08:58Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-09-09T17:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=2295de2c97e6d1290a86e0b160885212411510a5'/>
<id>urn:sha1:2295de2c97e6d1290a86e0b160885212411510a5</id>
<content type='text'>
Exiting the processing loop as soon as the dpkg process finishes might
leave status-fd lines unprocessed which wasn't much of a problem in the
past as the progress would just be slightly off, but now that we us the
information also for skipping already done tasks and generate warnings
if we didn't see all expected messages we should make sure we seem them
all. We still need to exit "early" if dpkg exited unsuccessfully/crashed
through as the (remaining) status lines we get could be incomplete.
</content>
</entry>
<entry>
<title>Fix typos reported by codespell &amp; spellintian</title>
<updated>2018-08-29T15:51:43Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-08-29T15:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=c4862d49bbc30c37f4fca966ac515692e26d93be'/>
<id>urn:sha1:c4862d49bbc30c37f4fca966ac515692e26d93be</id>
<content type='text'>
No user-visible change as it effects mostly code comments and
not a single error message, manpage or similar.

Reported-By: codespell &amp; spellintian
Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>Don't use invalid iterator in Fallback-Of handling</title>
<updated>2018-08-29T15:50:31Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-08-22T07:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=55585d0f93de1a0e60858e594b1b3b46f4a0831f'/>
<id>urn:sha1:55585d0f93de1a0e60858e594b1b3b46f4a0831f</id>
<content type='text'>
cppcheck reports: (error) Iterator 't' used after element has been erased.

The loop is actually fashioned to deal with this (not in the most
efficient way, but in simplest and speed isn't really a concern here)
IF this codepath had a "break" at the end… so I added one.

Note that the tests aren't failing before (and hopefully after) the
change as the undefined behavior we encounter is too stable.

Thanks: David Binderman for reporting
</content>
</entry>
<entry>
<title>clear alternative URIs for mirror:// between steps (CVE-2018-0501)</title>
<updated>2018-08-20T16:29:16Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2018-08-18T15:32:04Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=29658a3a74af49e2a24e17bdebb20e1612aac3ec'/>
<id>urn:sha1:29658a3a74af49e2a24e17bdebb20e1612aac3ec</id>
<content type='text'>
APT in 1.6 saw me rewriting the mirror:// transport method, which works
comparable to the decommissioned httpredir.d.o "just" that apt requests
a mirror list and performs all the redirections internally with all the
bells like parallel download and automatic fallback (more details in the
apt-transport-mirror manpage included in the 1.6 release).

The automatic fallback is the problem here: The intend is that if a file
fails to be downloaded (e.g. because the mirror is offline, broken,
out-of-sync, …) instead of erroring out the next mirror in the list is
contacted for a retry of the download.

Internally the acquire process of an InRelease file (works with the
Release/Release.gpg pair, too) happens in steps: 1) download file and 2)
verify file, both handled as URL requests passed around. Due to an
oversight the fallbacks for the first step are still active for the
second step, so that the successful download from another mirror stands
in for the failed verification… *facepalm*

Note that the attacker can not judge by the request arriving for the
InRelease file if the user is using the mirror method or not. If entire
traffic is observed Eve might be able to observe the request for
a mirror list, but that might or might not be telling if following
requests for InRelease files will be based on that list or for another
sources.list entry not using mirror (Users have also the option to have
the mirror list locally (via e.g. mirror+file://) instead of on a remote
host). If the user isn't using mirror:// for this InRelease file apt
will fail very visibly as intended.

(The mirror list needs to include at least two mirrors and to work
reliably the attacker needs to be able to MITM all mirrors in the list.
For remotely accessed mirror lists this is no limitation as the attacker
is in full control of the file in that case)

Fixed by clearing the alternatives after a step completes (and moving a pimpl
class further to the top to make that valid compilable code). mirror://
is at the moment the only method using this code infrastructure (for all
others this set is already empty) and the only method-independent user
so far is the download of deb files, but those are downloaded and
verified in a single step; so there shouldn't be much opportunity for
regression here even through a central code area is changed.

Upgrade instructions: Given all apt-based frontends are affected, even
additional restrictions like signed-by are bypassed and the attack in
progress is hardly visible in the progress reporting of an update
operation (the InRelease file is marked "Ign", but no fallback to
"Release/Release.gpg" is happening) and leaves no trace (expect files
downloaded from the attackers repository of course) the best course of
action might be to change the sources.list to not use the mirror family
of transports ({tor+,…}mirror{,+{http{,s},file,…}}) until a fixed
version of the src:apt packages are installed.

Regression-Of: 355e1aceac1dd05c4c7daf3420b09bd860fd169d,
 57fa854e4cdb060e87ca265abd5a83364f9fa681
LP: #1787752
</content>
</entry>
<entry>
<title>Set DPKG_FRONTEND_LOCKED as needed when doing selection changes</title>
<updated>2018-08-08T13:20:44Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2018-08-08T13:19:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=55489885b51b02b7f74e601a393ecaefd1f71f9c'/>
<id>urn:sha1:55489885b51b02b7f74e601a393ecaefd1f71f9c</id>
<content type='text'>
We forgot to set the variable for the selection changes. Let's
set it for that and some other dpkg calls.

Regression-Of: c2c8b4787b0882234ba2772ec7513afbf97b563a
</content>
</entry>
</feed>
