tracker-extract crashes with SIGSYS when upgrading from 20.04 to 22.04

Bug #1983859 reported by Simon Chopin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tracker-miners (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Released
High
Unassigned
ubuntu-release-upgrader (Ubuntu)
Invalid
High
Unassigned
Focal
Invalid
High
Unassigned

Bug Description

[Impact]
The crash will prompt users during the ugprade, leaving a relatively bad user experience, compounded by the fact that the issue is marked by apport as "Unreportable" since the exec that crashed has usually been removed during the upgrade by the time the user tries to report it.

[Fix]
The crash is due to the Focal tracker-extract binary being triggered during the upgrade while its dependencies, including glibc have already been switched to their Jammy version, leading to new syscalls being used that the Focal seccomp filter didn't know about, notably fstatat64.

There's an upstream commit addressing this specific issue that has been cherry-picked in both Hirsute and Debian, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983637

The fix is just backporting this patch further back to Focal, adding fstatat64 and newfstatat to the allowed-list of the seccomp filter. I consider those two syscalls fairly safe and legitimate.

[Test plan]
- Boot a pristine Focal VM
- Install tracker-extract & tracker-miners from -proposed
- run do-release-upgrade -d
  -> continue through the "do you want to continue" prompts
=> If all goes well the upgrade should finish and ask you to reboot
=> Otherwise you'd have a tracker-extract crash during the dist-upgrade phase of the upgrade

[Regression potential]
Messing with the seccomp filter could lead to the filter being made either too restrictive, making tracker-extract crash whenever called, or too permissive, weakening the sandboxing for this binary. That latter possibility is IMO more worrisome given the purpose of the package.

[Original report]
When upgrading Ubuntu Desktop from 20.04 to 22.04, there's often (pretty much always) a crash from tracker-extract, as described in the following error report:

https://errors.ubuntu.com/oops/d7866d85-14cc-11ed-a52b-fa163e55efd0

The crash occurs during the upgrade, which means it's fairly hard to investigate exactly what's going on as apport fails to extract a stack trace, the binaries being overwritten during the upgrade.

However, the crash occurs because of a unhandled SIGSYS, meaning a seccomp filter issue. I've tried backporting this patch fixing a similar issue:

https://gitlab.gnome.org/GNOME/tracker-miners/-/commit/4cda983b02e49f6bd28b94a6b96c9fe7026887ef

but it doesn't apply, likely due to the code having diverged too much since.

My proposal is thus to disable tracker-extract during upgrade, including in all user sessions. I'm assuming that the new version will be enabled automatically as its unit file changed name anyway.

Simon Chopin (schopin)
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
importance: Undecided → High
tags: added: fr-2595
Revision history for this message
Benjamin Drung (bdrung) wrote :

I tried to produce a usable backtrace by copying the crash file back to a VM that were in the state before the upgrade, but the backtrace there has GDB warnings: Section `.reg-xstate/$number' in core file too small. I assume that the crash happens when already some package were updated.

What I saw the the journal log: dbus-daemon[813]: Unknown group "power" in message bus configuration file

You can try to create the GDB backtrace directly after the crash. Modify ExecStart in
/usr/lib/systemd/user/tracker-extract.service to:

ExecStart=/usr/bin/gdb --batch --ex run --ex bt /usr/libexec/tracker-extract

Simon Chopin (schopin)
affects: tracker (Ubuntu) → tracker-miners (Ubuntu)
Simon Chopin (schopin)
description: updated
description: updated
Revision history for this message
Simon Chopin (schopin) wrote :

Turns out disabling the service wasn't that easy, but bdrung's helpful tip allowed me to narrow down the first problematic syscall to be fstatat64, which in turn led me to an upstream patch that we actually already cherry-picked in Hirsute.

Attached is the debdiff for the package that I'd like to upload, I'll just find a helpful Desktop team member to review it before actually uploading.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

That patch makes sense to me. It would be nice to get this SRU expedited so that most people upgrading from 20.04 LTS can avoid the crash.

Changed in ubuntu-release-upgrader (Ubuntu Focal):
importance: Undecided → High
Changed in tracker-miners (Ubuntu Focal):
importance: Undecided → High
Changed in tracker-miners (Ubuntu):
status: Confirmed → Fix Released
Changed in tracker-miners (Ubuntu Focal):
status: New → Triaged
Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Triaged
Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: New → Triaged
Revision history for this message
Benjamin Drung (bdrung) wrote :

IMO we should get this fix into jammy-updates before enabling the upgrade for everyone.

tags: added: patch
Simon Chopin (schopin)
Changed in tracker-miners (Ubuntu Focal):
status: Triaged → Fix Committed
Revision history for this message
Simon Chopin (schopin) wrote :

Uploaded, waiting in the Unapproved queue for now.

Changed in tracker-miners (Ubuntu Focal):
status: Fix Committed → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Simon, or anyone else affected,

Accepted tracker-miners into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/tracker-miners/2.3.3-2ubuntu0.20.04.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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 tracker-miners (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → Invalid
Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: Triaged → Invalid
Revision history for this message
Benjamin Drung (bdrung) wrote :

Tested in a VM: Enabled -proposed, upgraded the two packages, disabled -proposed and ran an upgrade:

```
sudo apt install tracker-extract/focal-proposed tracker-miner-fs/focal-proposed
update-manager -cd
```

/var/crash was still empty after an successful upgrade to Ubuntu 22.04. So successful verified the fix.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tracker-miners - 2.3.3-2ubuntu0.20.04.1

---------------
tracker-miners (2.3.3-2ubuntu0.20.04.1) focal; urgency=medium

  * d/p/libtracker-miners-common-Add-newstatat-statat64-syscalls.patch:
    cherry-picked from upstream to prevent seccomp crashes with newer glibc,
    notably during dist-upgrade. (LP: #1983859)

 -- Simon Chopin <email address hidden> Wed, 10 Aug 2022 14:05:34 +0200

Changed in tracker-miners (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for tracker-miners 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.

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.