620.70.06: NULL deref in ConnectorImpl::ensureMstNodesPoweredUp (via ConnectorImpl2x::notifyAttachBegin) on first modeset after s2idle resume — kwin_wayland killed, black screen

Ouverte
#1,568 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
42/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
c

Piste de recherche

Start by reading src/common/displayport group and device lifetime code, then trace ConnectorImpl::ensureMstNodesPoweredUp and ConnectorImpl2x::notifyAttachBegin against the reported call stack. The report describes a possible stale DeviceImpl after s2idle resume, but does not identify a specific source file or reproducing test. Done means resolving the device lifetime failure and preventing the first modeset after resume from dereferencing a null vtable.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

NVIDIA Driver Version

620.70.06 (open kernel modules)

Operating System and Version

Arch Linux (CachyOS kernel)

Kernel Release

7.3.4-1-cachyos

Hardware

  • GPU: GeForce RTX 5060 Ti (GB206, 10de:2d04), VBIOS 98.06.4E.40.38
  • iGPU also present: AMD Renoir (amdgpu); display connected only to the NVIDIA card
  • Board: B450M (BIOS 5.17, 12/13/2024)
  • Display: LG UltraGear over DisplayPort, single monitor, direct connection (no hub/dock/MST)

Software

  • KDE Plasma 6.8.3, kwin_wayland 6.8.3 (Wayland session)
  • nvidia_drm.modeset=1, nvidia_drm.fbdev=1
  • nvidia-suspend/resume/hibernate systemd services: disabled
  • PreserveVideoMemoryAllocations: 2, DynamicPowerManagement: 3

Describe the bug

The system suspended (s2idle) after an idle period. On wake, the kernel resumed normally (disks, network and audio came back), but ~2 seconds after PM: suspend exit, the first atomic commit from kwin_wayland oopsed inside nvidia_modeset. kwin_wayland was killed with IRQs disabled, the display stayed black, and only a hard reset got the machine back. The rest of the system stayed alive; it kept logging network traffic for several minutes.

Earlier in the same boot (about 3 h before the suspend), this warning appeared once:
WARNING: nvidia-drm/nvidia-drm-crtc.h:371 at __nv_drm_handle_flip_event (nv_flip == NULL).

Analysis

The faulting instruction is at ensureMstNodesPoweredUp+0x53:

48 8b 03        mov rax, [rbx]        ; rbx = Device* from target->enumDevices()
48 8b 40 18     mov rax, [rax+0x18]   ; <-- faults: vtable pointer is NULL (CR2 = 0x18)
48 3d ...       cmp rax, <fn>         ; devirtualization check for dev->isVideoSink()

So the Device* returned by target->enumDevices() points to an object whose vtable pointer is 0. That looks like a stale or freed DeviceImpl still linked in the Group after resume. The monitor was probably re-detected or removed during resume while the group membership wasn't updated. The connector-state guard at the top of the function (connectorActive / isDiscoveryDetectComplete) did not catch it.

Note that notifyAttachBegin iterates the same list right after ensureMstNodesPoweredUp() returns. So adding a linkUseMultistream() guard (this is an SST link) would only move the crash, not fix the lifetime problem.

I checked the 620.73.04 tag: ensureMstNodesPoweredUp and the group/device lifetime code in src/common/displayport are unchanged, so this is likely still present. This may be related to #1454 (NULL deref on modeset after DP re-plug).

To Reproduce

  1. Wayland session (KWin) on RTX 50-series, single DP monitor.
  2. Let the system auto-suspend (s2idle) for ~1 h.
  3. Wake it. The crash happens on the first modeset after resume.

This has happened once so far, so it is not reliably reproducible.

Kernel log (oops)

PM: suspend exit
BUG: kernel NULL pointer dereference, address: 0000000000000018
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
Oops: Oops: 0000 [#1] SMP NOPTI
CPU: 2 UID: 1000 PID: 906 Comm: kwin_wayland Tainted: G        W  O        7.3.4-1-cachyos #1 PREEMPT(full)
RIP: 0010:_ZN11DisplayPort13ConnectorImpl23ensureMstNodesPoweredUpEPNS_5GroupE.part.0+0x53/0x2e0 [nvidia_modeset]
Code: ... 48 89 c3 0f 1f 00 48 8b 03 <48> 8b 40 18 48 3d d0 61 b6 c1 0f 85 1d 02 00 00 ...
RAX: 0000000000000000 RBX: ffff8b6b211fc008
Call Trace:
 _ZN11DisplayPort15ConnectorImpl2x17notifyAttachBeginEPNS_5GroupERKNS_15DpModesetParamsE+0x263/0xe00 [nvidia_modeset]
 _ZN11DisplayPort13ConnectorImpl12dpPreModesetERKNS_18DpPreModesetParamsE+0x87/0x150 [nvidia_modeset]
 nvDPPreSetMode+0x144/0x250 [nvidia_modeset]
 KickoffModesetUpdateState+0xe8/0x220 [nvidia_modeset]
 nvSetDispModeEvo+0x3e98/0x4c00 [nvidia_modeset]
 nvKmsIoctl+0xdc/0x1b0 [nvidia_modeset]
 nvkms_ioctl_from_kapi_try_pmlock+0x4b/0x80 [nvidia_modeset]
 ApplyModeSetConfig+0xd98/0xfb0 [nvidia_modeset]
 nv_drm_atomic_commit+0x584/0xab0 [nvidia_drm]
 drm_atomic_commit+0xc3/0xf0
 drm_mode_atomic_ioctl.cold+0x348/0x5d8
 drm_ioctl+0x305/0x4d0
 do_syscall_64+0x8f/0x380
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
note: kwin_wayland[906] exited with irqs disabled

Bug Incidence

Once

nvidia-bug-report.log.gz

(to attach: generated after the next occurrence)

Langage dominant
C
Étoiles
17.7k
Forks
2k
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de NVIDIA/open-gpu-kernel-modules

Toutes les issues de NVIDIA/open-gpu-kernel-modules

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.