** Description changed:

  [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/.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1737441

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

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to