diff -Nru apport-2.20.9/apport/ui.py apport-2.20.9/apport/ui.py --- apport-2.20.9/apport/ui.py 2018-04-05 00:48:52.000000000 +0000 +++ apport-2.20.9/apport/ui.py 2018-05-30 22:15:33.000000000 +0000 @@ -578,7 +578,6 @@ self.add_extra_tags() # delete the uninteresting keys - del self.report['ProblemType'] del self.report['Date'] try: del self.report['SourcePackage'] diff -Nru apport-2.20.9/data/apport apport-2.20.9/data/apport --- apport-2.20.9/data/apport 2018-02-14 18:32:43.000000000 +0000 +++ apport-2.20.9/data/apport 2018-05-10 20:58:33.000000000 +0000 @@ -427,19 +427,20 @@ sys.exit(0) sys.exit(0) - elif not is_same_ns(host_pid, "pid") and is_same_ns(host_pid, "mnt"): + elif not is_same_ns(host_pid, "mnt"): + error_log('host pid %s crashed in a separate mount namespace, ignoring' % host_pid) + sys.exit(0) + else: # If it doesn't look like the crash originated from within a - # full container, then take the global pid and replace the local - # pid with it, then move on to normal handling. + # full container or if the is_same_ns() function fails open (returning + # True), then take the global pid and replace the local pid with it, + # then move on to normal handling. # This bit is needed because some software like the chrome # sandbox will use container namespaces as a security measure but are # still otherwise host processes. When that's the case, we need to keep # handling those crashes locally using the global pid. sys.argv[1] = str(host_pid) - elif not is_same_ns(host_pid, "mnt"): - error_log('host pid %s crashed in a separate mount namespace, ignoring' % host_pid) - sys.exit(0) check_lock() diff -Nru apport-2.20.9/data/general-hooks/ubuntu.py apport-2.20.9/data/general-hooks/ubuntu.py --- apport-2.20.9/data/general-hooks/ubuntu.py 2017-11-20 16:39:28.000000000 +0000 +++ apport-2.20.9/data/general-hooks/ubuntu.py 2018-05-30 22:19:49.000000000 +0000 @@ -519,6 +519,9 @@ def add_python_details(key, python, report): '''Add comma separated details about which python is being used''' python_path = apport.hookutils.command_output(['which', python]) + if python_path.startswith('Error: '): + report[key] = 'N/A' + return python_link = apport.hookutils.command_output(['readlink', '-f', python_path]) python_pkg = apport.fileutils.find_file_package(python_path) diff -Nru apport-2.20.9/data/package-hooks/source_linux.py apport-2.20.9/data/package-hooks/source_linux.py --- apport-2.20.9/data/package-hooks/source_linux.py 2017-11-20 16:39:28.000000000 +0000 +++ apport-2.20.9/data/package-hooks/source_linux.py 2018-05-30 22:18:25.000000000 +0000 @@ -34,9 +34,10 @@ report['UnreportableReason'] = 'The running kernel is not an Ubuntu kernel' return - # Prevent reports against the linux-meta family, redirect to the main package. - if report['SourcePackage'].startswith('linux-meta'): - report['SourcePackage'] = report['SourcePackage'].replace('linux-meta', 'linux', 1) + # Prevent reports against the linux-meta and linux-signed families, redirect to the main package. + for src_pkg in ['linux-meta', 'linux-signed']: + if report['SourcePackage'].startswith(src_pkg): + report['SourcePackage'] = report['SourcePackage'].replace(src_pkg, 'linux', 1) report.setdefault('Tags', '') diff -Nru apport-2.20.9/debian/apport.links apport-2.20.9/debian/apport.links --- apport-2.20.9/debian/apport.links 2017-11-20 16:39:28.000000000 +0000 +++ apport-2.20.9/debian/apport.links 2018-05-30 22:18:19.000000000 +0000 @@ -1,4 +1,5 @@ /usr/share/apport/package-hooks/source_linux.py /usr/share/apport/package-hooks/source_linux-meta.py +/usr/share/apport/package-hooks/source_linux.py /usr/share/apport/package-hooks/source_linux-signed.py /usr/bin/apport-bug /usr/bin/ubuntu-bug /usr/share/man/man1/apport-bug.1.gz /usr/share/man/man1/ubuntu-bug.1.gz /usr/share/man/man1/apport-bug.1.gz /usr/share/man/man1/apport-collect.1.gz diff -Nru apport-2.20.9/debian/changelog apport-2.20.9/debian/changelog --- apport-2.20.9/debian/changelog 2018-04-24 20:02:54.000000000 +0000 +++ apport-2.20.9/debian/changelog 2018-05-30 22:19:49.000000000 +0000 @@ -1,3 +1,27 @@ +apport (2.20.9-0ubuntu7.2) bionic; urgency=medium + + * apport/ui.py: Include ProblemType in reports which are updated as + package hooks may expect the report to have a ProblemType. (LP: #1766794) + * test/test_ui.py: modify run_crash_kernel test to account for the fact + that linux-image-$kvers-$flavor is now built from the linux-signed + source package on amd64 and ppc64el. (LP: #1766740) + * data/general-hooks/ubuntu.py: Don't display a messy error if python or + python3 is not installed. (LP: #1769262) + * debian/apport.links: source_linux-signed.py -> source_linux.py package + hook (LP: #1773012) + * data/package-hooks/source_linux.py: Redirect bugs filed about the + linux-signed source package to linux. (LP: #1773012) + + -- Brian Murray Wed, 30 May 2018 15:19:49 -0700 + +apport (2.20.9-0ubuntu7.1) bionic-security; urgency=medium + + * data/apport: Properly handle crashes originating from a PID namespace. + (LP: #1746668) + - CVE-2018-6552 + + -- Brian Murray Thu, 10 May 2018 13:58:33 -0700 + apport (2.20.9-0ubuntu7) bionic; urgency=medium * debian/control: Drop x-terminal-emulator to Suggests: to avoid pulling diff -Nru apport-2.20.9/test/test_ui.py apport-2.20.9/test/test_ui.py --- apport-2.20.9/test/test_ui.py 2017-11-20 16:39:28.000000000 +0000 +++ apport-2.20.9/test/test_ui.py 2018-05-30 22:17:36.000000000 +0000 @@ -1,5 +1,5 @@ # coding: UTF-8 -import unittest, shutil, signal, tempfile, resource, pwd, time, os, sys +import unittest, shutil, signal, tempfile, resource, pwd, time, os, sys, imp import subprocess, errno, glob try: @@ -16,6 +16,11 @@ import apport.crashdb_impl.memory import stat +if os.environ.get('APPORT_TEST_LOCAL'): + impl = imp.load_source('', 'backends/packaging-apt-dpkg.py').impl +else: + from apport.packaging_impl import impl + logind_session = apport.Report.get_logind_session(os.getpid()) @@ -1259,8 +1264,14 @@ def test_run_crash_kernel(self): '''run_crash() for a kernel error''' + sys_arch = impl.get_system_architecture() + if sys_arch in ['amd64', 'ppc64el']: + src_pkg = 'linux-signed' + else: + src_pkg = 'linux' + # set up hook - f = open(os.path.join(self.hookdir, 'source_linux.py'), 'w') + f = open(os.path.join(self.hookdir, 'source_%s.py' % src_pkg), 'w') f.write('''def add_info(report, ui): report['KernelDebug'] = 'LotsMoreInfo' ''') @@ -1269,7 +1280,7 @@ # generate crash report r = apport.Report('KernelCrash') r['Package'] = apport.packaging.get_kernel_package() - r['SourcePackage'] = 'linux' + r['SourcePackage'] = src_pkg # write crash report report_file = os.path.join(apport.fileutils.report_dir, 'test.crash') @@ -1302,7 +1313,8 @@ self.assertEqual(self.ui.msg_severity, None, str(self.ui.msg_title) + ' ' + str(self.ui.msg_text)) self.assertEqual(self.ui.msg_title, None) - self.assertEqual(self.ui.opened_url, 'http://linux.bugs.example.com/%i' % self.ui.crashdb.latest_id()) + self.assertEqual(self.ui.opened_url, 'http://%s.bugs.example.com/%i' % + (src_pkg, self.ui.crashdb.latest_id())) self.assertTrue(self.ui.present_details_shown) self.assertTrue('SourcePackage' in self.ui.report.keys())