[SRU] fix suspend/resume when there are no input devices

Bug #2056331 reported by Talha Can Havadar
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
X.Org X server
Fix Released
Unknown
xorg-server (Ubuntu)
Fix Released
Medium
Talha Can Havadar
Jammy
Fix Committed
Medium
Talha Can Havadar
Mantic
Fix Committed
Undecided
Talha Can Havadar
Noble
Fix Released
Medium
Talha Can Havadar

Bug Description

[Impact]

Bug is impacting the suspend/resume flow when there is no input device connected to machine. xorg hangs in this case.

[Where problems could occur]

The problem could occur in places where there is no input device connected to the system but a suspend/resume is triggered.

[Test Case]

* Enable proposed updates (https://wiki.ubuntu.com/Testing/EnableProposed)
* Update xorg-server to the version in -proposed: sudo apt install -t jammy-proposed xorg-server
* Unplug all USB devices such as USB drive, keyboard, mouse, etc.
* Set RTC timer and suspend the system via UART console
    $ echo 8 > /proc/sys/kernel/printk
    $ sudo rtcwake -v -m no -s 240
    $ sudo systemctl suspend

[Regression Potential]

The patch defines a default behavior in systemd_logind_drop_master function so there is a possibility that there might be a regression that may affect all the systems that utilizes systemd_logind_drop_master

------------------------
Upstream Bug: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1387

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The fix is also missing from Noble so please start with Noble.

Changed in xorg-server (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
tags: added: jammy noble
Changed in xorg-server:
status: Unknown → Fix Released
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Daniel, thank you for your time I have attached the debdiff for noble as well.

Changed in xorg-server (Ubuntu Jammy):
status: New → In Progress
Changed in xorg-server (Ubuntu Noble):
status: Triaged → In Progress
Changed in xorg-server (Ubuntu Jammy):
importance: Undecided → Medium
assignee: nobody → Talha Can Havadar (tchavadar)
Changed in xorg-server (Ubuntu Noble):
assignee: nobody → Talha Can Havadar (tchavadar)
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

fix build error

Revision history for this message
Talha Can Havadar (tchavadar) wrote :
Revision history for this message
Talha Can Havadar (tchavadar) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

LGTM and matches upstream changes. Build OK. We'd also want this for Mantic, before backporting to Jammy. The patch is simple enough that I did that for you!

- Noble: https://launchpad.net/ubuntu/+source/xorg-server/2:21.1.11-2ubuntu2
- Mantic: https://launchpad.net/ubuntu/mantic/+queue?queue_state=1&queue_text=xorg-server (ported from the Jammy debdiff)
- Jammy: https://launchpad.net/ubuntu/jammy/+queue?queue_state=1&queue_text=xorg-server (fixed version string)

Changed in xorg-server (Ubuntu Mantic):
status: New → In Progress
Changed in xorg-server (Ubuntu Noble):
status: In Progress → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

you need to rebase these on top of current *-security

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Proposed package upload rejected

An upload of xorg-server to mantic-proposed has been rejected from the upload queue for the following reason: "needs to be rebased with mantic-security".

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

An upload of xorg-server to jammy-proposed has been rejected from the upload queue for the following reason: "needs to be rebased with jammy-security".

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Mantic debdiff rebased on mantic-security
Package is also build tested here: https://launchpad.net/~tchavadar/+archive/ubuntu/xorg-server-test/+packages

Changed in xorg-server (Ubuntu Mantic):
assignee: nobody → Talha Can Havadar (tchavadar)
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Jammy debdiff(jammy-2.debdiff) rebased on jammy-security
Package is also build tested here: https://launchpad.net/~tchavadar/+archive/ubuntu/xorg-server-test/+packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg-server - 2:21.1.12-1ubuntu1

---------------
xorg-server (2:21.1.12-1ubuntu1) noble; urgency=medium

  * Merge from Debian.

xorg-server (2:21.1.12-1) unstable; urgency=medium

  * New upstream release.
  * render: Avoid possible double-free in ProcRenderAddGlyphs()
    (closes: #1068470)

xorg-server (2:21.1.11-3) unstable; urgency=high

  [ Chris Hofstaedtler ]
  * Use udev.pc to place udev files (Closes: #1057945)

  [ Julien Cristau ]
  * Pull from upstream server-21.1-branch:
    - hw/xfree86: fix NULL pointer refrence to mode name
    - Initialize Mode->name in xf86CVTMode()
    - Allow disabling byte-swapped clients
    - Xext: SProcSyncCreateFence needs to swap drawable id too
    - Xi: ProcXIGetSelectedEvents needs to use unswapped length to send
      reply (CVE-2024-31080)
    - Xi: ProcXIPassiveGrabDevice needs to use unswapped length to send
      reply (CVE-2024-31081)
    - Xquartz: ProcAppleDRICreatePixmap needs to use unswapped length to
      send reply (CVE-2024-31082)
    - render: fix refcounting of glyphs during ProcRenderAddGlyphs
      (CVE-2024-31083)
  * dix-Fix-use-after-free-in-input-device-shutdown.patch: drop (now upstream).

 -- Timo Aaltonen <email address hidden> Fri, 12 Apr 2024 12:10:06 +0300

Changed in xorg-server (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

Thanks! The rebased patches do still apply cleanly and build fine.

- I fixed the Mantic debdiff SRU version "2:21.1.7-3ubuntu3" -> "2:21.1.7-3ubuntu2.10"
- I fixed the Jammy debdiff d/changelog to reference this bug report

Re-sponsoring for Mantic & Jammy and unsubcribing ~ubuntu-sponsors.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Talha, or anyone else affected,

Accepted xorg-server into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xorg-server/2:21.1.7-3ubuntu2.10 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-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. 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 xorg-server (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Changed in xorg-server (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Talha, or anyone else affected,

Accepted xorg-server into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xorg-server/2:21.1.4-2ubuntu1.7~22.04.11 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

Hello Timo,

On jammy,
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
```
I was able to reproduce the issue using old version of the xorg-server package(2:21.1.4-2ubuntu1.7~22.04.10), for the ones who are curious about the bug, first you need to boot the board with keyboard/mouse connected to usb and display attached and then login as usual. Then remove all usb device and follow the steps in bug description through tty console.

After enabling -proposed and updating xorg-server packages to 2:21.1.4-2ubuntu1.7~22.04.11, I followed the same steps to reproduce the bug.

I can confirm that the bug has been fixed with 2:21.1.4-2ubuntu1.7~22.04.11

Thank you all!

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Talha Can Havadar (tchavadar) wrote :

On Mantic,

I installed the package from mantic-proposed and applied the same steps as I did in jammy (mentioned in comment #19).
```
ubuntu@kria:~$ apt policy xserver-xorg-core
xserver-xorg-core:
  Installed: 2:21.1.7-3ubuntu2.10
  Candidate: 2:21.1.7-3ubuntu2.10
  Version table:
 *** 2:21.1.7-3ubuntu2.10 100
        100 http://ports.ubuntu.com/ubuntu-ports mantic-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
```

After removing all connected usb devices from the board did a suspend/resume test and everything is working fine in mantic version of the package as well.

tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (xorg-server/2:21.1.4-2ubuntu1.7~22.04.11)

All autopkgtests for the newly accepted xorg-server (2:21.1.4-2ubuntu1.7~22.04.11) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

airport-utils/2-8 (armhf)
apport/2.20.11-0ubuntu82.5 (armhf)
at-spi2-atk/2.38.0-3 (i386)
auto-multiple-choice/unknown (armhf)
libsoup3/3.0.7-0ubuntu1 (s390x)
mutter/42.9-0ubuntu7 (arm64)
nvidia-graphics-drivers-390/390.157-0ubuntu0.22.04.2 (armhf)
pytest-qt/4.0.2-1 (armhf)
python-qtpy/2.0.0-3 (amd64, arm64, armhf, ppc64el, s390x)
sasview/5.0.4-1 (armhf)
sphinx/4.3.2-1 (s390x)
update-manager/1:22.04.20 (amd64, arm64, armhf, i386, ppc64el, s390x)
xlbiff/4.6.3-1 (arm64)
xpra/3.1-1build5 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#xorg-server

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (xorg-server/2:21.1.7-3ubuntu2.10)

All autopkgtests for the newly accepted xorg-server (2:21.1.7-3ubuntu2.10) for mantic have finished running.
The following regressions have been reported in tests triggered by the package:

at-spi2-core/2.50.0-1 (armhf)
balsa/2.6.4-2 (armhf)
cataclysm-dda/0.G-4 (armhf)
dogtail/0.9.11-12 (armhf)
jsurf-alggeo/0.4.1+ds-4ubuntu1 (armhf)
libsoup2.4/2.74.3-1 (arm64)
mediaconch/23.07-1 (armhf)
mutter/45.2-0ubuntu4 (armhf)
openmsx/19.0-1ubuntu1 (armhf)
pango1.0/1.51.0+ds-2 (armhf)
puzzle-jigsaw/1.0.2+git20201007.527c529+dfsg-4 (arm64)
rust-gtk4/0.7.3-2 (armhf)
rust-x11-clipboard/0.6.1-1 (armhf)
silx/1.1.2+dfsg-2 (armhf)
surf/2.1+git20221016-5 (arm64)
ubuntu-release-upgrader/1:23.10.14 (arm64, armhf, ppc64el, s390x)
uqm/0.8.0+dfsg-2 (armhf)
xlbiff/4.6.5-1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/mantic/update_excuses.html#xorg-server

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Talha Can Havadar (tchavadar) wrote :

I am not sure these tests failures really a regression or not. I checked some of them happening due to permission error some of them failed due to infrastructure errors. Is it maybe a good idea to re-trigger tests to at least see the ones that are happening due to infra problems are running correctly?

Some of them happening due to syntax errors in tests some of them happening due to missing header files. So I dont thing these are introduced with our patch. Can someone knowledgeable check the failures as well? Maybe they are already known issues?

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.