← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1737441] Re: python-apt crashes if objects of one cache are passed to depcache belonging to another cache

 

This bug was fixed in the package python-apt - 0.9.3.5ubuntu3

---------------
python-apt (0.9.3.5ubuntu3) trusty-proposed; urgency=medium

  * DepCache: Check that candidate we are setting belongs to package
  * Raise CacheMismatchError if objects passed to DepCache are from different cache
    (LP: #1737441); also includes the following regression fixes from bionic:
    - apt.Cache: Remap objects when reopening cache (LP: 1773316 in bionic+), incl. regression fixes:
      + Add more extensive test cases for cache remapping
      + Regression fix: Do not override __hash__ in apt.package.Package (LP: 1780099 in bionic+)
  * CI / pre-build / data changes:
    - Replace broken travis CI integration with current docker-based one
    - utils/get_debian_mirrors.py: Get data from salsa (for pre-build hook)
    - debian/control: Point to salsa instead of anonscm
    - debian/gbp.conf: Point to ubuntu/trusty branch
    - Updated mirror list

 -- Julian Andres Klode <juliank@xxxxxxxxxx>  Tue, 10 Jul 2018 16:59:07
+0200

** Changed in: python-apt (Ubuntu Trusty)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1737441

Title:
  python-apt crashes if objects of one cache are passed to depcache
  belonging to another cache

Status in python-apt package in Ubuntu:
  Fix Released
Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in python-apt source package in Trusty:
  Fix Released
Status in unattended-upgrades source package in Trusty:
  Won't Fix
Status in python-apt source package in Xenial:
  Fix Released
Status in unattended-upgrades source package in Xenial:
  Won't Fix
Status in python-apt source package in Bionic:
  Fix Released
Status in unattended-upgrades source package in Bionic:
  Fix Released

Bug description:
  [Impact]
  Some applications, like unattended-upgrades or update-manager, reopen the apt cache. They also keep around old apt.Package objects however, and operate on them after reopening. Under the hood, this means that apt_pkg.Package objects belonging to an old cache are passed to a new cache.

  APT relies on the ID of the package (it's position in the cache) for
  it's operation. So if a package has ID 0 in the old cache, and a
  different package has ID 0 in the new cache, performing operations on
  the old package would perform it on the new package. If the old
  package's ID is out of bounds in the new cache, the behavior is
  undefined - it's an out of bounds array access.

  [Test case]
  The attached test case has a list of packages 0-9, a-z; stores the package "z" into a variable, then reopens the cache. It then marks z for deletion. This either segfaults or does nothing; when it should mark z for deletion.

  More test cases like this are in the autopkgtest.

  [Regression potential]
  The initial fix introduced bug 1780099, there might be similar bugs lurking. However, these bugs would have been undefined behavior before and might have caused segmentation faults or did the wrong thing. It seems likely that any regression cannot possibly be worse than the current state.

  [Other info]
  The xenial SRU also includes the change "python/tag.cc: Fix invalid read in TagFileNext". We don't have any specific verification for it, as we just saw weird crashes on the error tracker, and this seemed like the culprit. We released bionic with it, and it seems fine.  The fix is fairly obvious: We were copying the char array "Start" which was not nul terminated in an odd way, without using the lenght.

  [Original bug report]
  The Ubuntu Error Tracker has been receiving reports about a problem regarding unattended-upgrades.  This problem was most recently seen with package version 0.98ubuntu1, the problem page at https://errors.ubuntu.com/problem/727153285ba3335a07f801a298a3d94cbe6ba05d contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
  If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1737441/+subscriptions