Nvidia drm crashes the system if I play a video stored on a UFS2 filesystem configured in read only mode

Hello.

I was reproducing a video file stored on a UFS2 fs configured in READ ONLY mode with a lot of media players,but no one worked great and suddenly it stopped going. And yes,everytime I do the same thing,everytime I get the same errors. I’ve checked what could have happened and between the dmesg messages I saw this :

[  402.975062] ================================================================================
[  402.975065] UBSAN: shift-out-of-bounds in /build/linux-Xjc4na/linux-6.2.0/fs/ufs/super.c:1246:19
[  402.975067] shift exponent 36 is too large for 32-bit type 'int'
[  402.975069] CPU: 0 PID: 6023 Comm: mount Tainted: P           OE      6.2.0-24-generic #24-Ubuntu
[  402.975071] Hardware name: Gigabyte Technology Co., Ltd. Z390 AORUS PRO/Z390 AORUS PRO-CF, BIOS F12g GA9 06/08/2020
[  402.975072] Call Trace:
[  402.975073]  <TASK>
[  402.975075]  dump_stack_lvl+0x48/0x70
[  402.975079]  dump_stack+0x10/0x20
[  402.975080]  __ubsan_handle_shift_out_of_bounds+0x1ac/0x360
[  402.975084]  ? __pfx_wake_bit_function+0x10/0x10
[  402.975086]  ufs_fill_super.cold+0x1e9/0x20a [ufs]
[  402.975092]  ? snprintf+0x51/0x80
[  402.975094]  mount_bdev+0x19b/0x1d0
[  402.975096]  ? __pfx_ufs_fill_super+0x10/0x10 [ufs]
[  402.975102]  ufs_mount+0x15/0x30 [ufs]
[  402.975107]  legacy_get_tree+0x28/0x60
[  402.975109]  vfs_get_tree+0x27/0xe0
[  402.975111]  do_new_mount+0x18b/0x320
[  402.975114]  path_mount+0x1e4/0x820
[  402.975116]  ? putname+0x5d/0x80
[  402.975118]  __x64_sys_mount+0x127/0x160
[  402.975121]  do_syscall_64+0x58/0x90
[  402.975123]  ? __put_cred+0x43/0x80
[  402.975125]  ? revert_creds+0x3d/0x50
[  402.975127]  ? do_faccessat+0x139/0x280
[  402.975129]  ? exit_to_user_mode_prepare+0x30/0xb0
[  402.975131]  ? syscall_exit_to_user_mode+0x29/0x50
[  402.975133]  ? do_syscall_64+0x67/0x90
[  402.975135]  ? do_syscall_64+0x67/0x90
[  402.975136]  ? do_syscall_64+0x67/0x90
[  402.975138]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
[  402.975140] RIP: 0033:0x7ff0bc51ee7e
[  402.975142] Code: 48 8b 0d 9d 6f 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 6a 6f 0d 00 f7 d8 64 89 01 48
[  402.975143] RSP: 002b:00007ffcc54a0d78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
[  402.975145] RAX: ffffffffffffffda RBX: 0000561d41c2eac0 RCX: 00007ff0bc51ee7e
[  402.975146] RDX: 0000561d41c2ed80 RSI: 0000561d41c2edc0 RDI: 0000561d41c2eda0
[  402.975147] RBP: 0000000000000000 R08: 0000561d41c2ecf0 R09: 00007ffcc549fc71
[  402.975148] R10: 0000000000000001 R11: 0000000000000246 R12: 0000561d41c2eda0
[  402.975149] R13: 0000561d41c2ed80 R14: 00000000ffffffff R15: 00007ff0bc80b076
[  402.975150]  </TASK>
[  402.975151] ================================================================================
[ 6552.848161] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
[ 6552.870342] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000200] Failed to grab modeset ownership
[ 6553.275920] totem[12309]: segfault at 1 ip 00007f3069d73b1d sp 00007ffea210d788 error 4 in libc.so.6[7f3069c22000+178000] likely on CPU 15 (core 7, socket 0)
[ 6553.275929] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 <c5> fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66

whats happening ? my nvidia gpus are working correctly :

# nvidia-smi

Fri Jun 30 01:59:33 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.116.04   Driver Version: 525.116.04   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 58%   42C    P0    31W / 120W |    405MiB /  3072MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:02:00.0 Off |                  N/A |
| 30%   38C    P8    20W / 250W |      6MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3592      G   /usr/lib/xorg/Xorg                185MiB |
|    0   N/A  N/A      3678      G   xfwm4                               2MiB |
|    0   N/A  N/A      3711      G   /usr/lib/firefox/firefox          213MiB |
|    1   N/A  N/A      3592      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+

I cannot reproduce any video file,no media player works,no audio works anymore,the system became not stable anymore and I should reboot.

I’m running ubuntu 23.04 ; I have 2 graphics card on my PC :

01:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
02:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
02:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1)
02:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1)