In the Linux kernel, the following vulnerability has been resolved:
drm/gma500: Fix BUG: sleeping function called from invalid context errors
gmacrtcpageflip() was holding the eventlock spinlock while calling crtcfuncs->modesetbase() which takes wwmutex.
The only reason to hold eventlock is to clear gmacrtc->pageflipevent on modesetbase() errors.
Instead unlock it after setting gmacrtc->pageflipevent and on errors re-take the lock and clear gmacrtc->pageflipevent it it is still set.
This fixes the following WARN/stacktrace:
[ 512.122953] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:870 [ 512.123004] inatomic(): 1, irqsdisabled(): 1, nonblock: 0, pid: 1253, name: gnome-shell [ 512.123031] preemptcount: 1, expected: 0 [ 512.123048] RCU nest depth: 0, expected: 0 [ 512.123066] INFO: lockdep is turned off. [ 512.123080] irq event stamp: 0 [ 512.123094] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [ 512.123134] hardirqs last disabled at (0): [<ffffffff8d0ec28c>] copyprocess+0x9fc/0x1de0 [ 512.123176] softirqs last enabled at (0): [<ffffffff8d0ec28c>] copyprocess+0x9fc/0x1de0 [ 512.123207] softirqs last disabled at (0): [<0000000000000000>] 0x0 [ 512.123233] Preemption disabled at: [ 512.123241] [<0000000000000000>] 0x0 [ 512.123275] CPU: 3 PID: 1253 Comm: gnome-shell Tainted: G W 5.19.0+ #1 [ 512.123304] Hardware name: Packard Bell dot s/SJE01CT, BIOS V1.10 07/23/2013 [ 512.123323] Call Trace: [ 512.123346] <TASK> [ 512.123370] dumpstacklvl+0x5b/0x77 [ 512.123412] _mightresched.cold+0xff/0x13a [ 512.123458] wwmutexlock+0x1e/0xa0 [ 512.123495] psbgempin+0x2c/0x150 [gma500gfx] [ 512.123601] gmapipesetbase+0x76/0x240 [gma500gfx] [ 512.123708] gmacrtcpageflip+0x95/0x130 [gma500gfx] [ 512.123808] drmmodepageflipioctl+0x57d/0x5d0 [ 512.123897] ? drmmodecursor2ioctl+0x10/0x10 [ 512.123936] drmioctlkernel+0xa1/0x150 [ 512.123984] drmioctl+0x21f/0x420 [ 512.124025] ? drmmodecursor2ioctl+0x10/0x10 [ 512.124070] ? rcureadlockbhheld+0xb/0x60 [ 512.124104] ? lockrelease+0x1ef/0x2d0 [ 512.124161] _x64sysioctl+0x8d/0xd0 [ 512.124203] dosyscall64+0x58/0x80 [ 512.124239] ? dosyscall64+0x67/0x80 [ 512.124267] ? tracehardirqsonprepare+0x55/0xe0 [ 512.124300] ? dosyscall64+0x67/0x80 [ 512.124340] ? rcureadlockschedheld+0x10/0x80 [ 512.124377] entrySYSCALL64afterhwframe+0x63/0xcd [ 512.124411] RIP: 0033:0x7fcc4a70740f [ 512.124442] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00 [ 512.124470] RSP: 002b:00007ffda73f5390 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 512.124503] RAX: ffffffffffffffda RBX: 000055cc9e474500 RCX: 00007fcc4a70740f [ 512.124524] RDX: 00007ffda73f5420 RSI: 00000000c01864b0 RDI: 0000000000000009 [ 512.124544] RBP: 00007ffda73f5420 R08: 000055cc9c0b0cb0 R09: 0000000000000034 [ 512.124564] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000c01864b0 [ 512.124584] R13: 0000000000000009 R14: 000055cc9df484d0 R15: 000055cc9af5d0c0 [ 512.124647] </TASK>
{ "vanir_signatures": [ { "signature_type": "Function", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c", "function": "gma_crtc_page_flip" }, "digest": { "function_hash": "133231589083785085387079770339147885013", "length": 855.0 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-1fe34965", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e5ae504c8623476e13032670f1a6d6344d53ec9b" }, { "signature_type": "Line", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c" }, "digest": { "line_hashes": [ "326440798024638431266732621414268041968", "338757558822754854895352904672238490332", "261636347292756436578229651529971811582", "66674566450220555016804516126918483046", "66881723990388709066266615872338351867", "276246483805205850372409357029020122528", "147754690285036704551226725959645938020", "262282139772735274220797524788513791494", "233145116548514954000555965837520107624", "88344231342979707582315202554909704925" ], "threshold": 0.9 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-2927b681", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a6ed7624bf4d0a32f2631e74828bca7b7bf15afd" }, { "signature_type": "Function", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c", "function": "gma_crtc_page_flip" }, "digest": { "function_hash": "133231589083785085387079770339147885013", "length": 855.0 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-5d969822", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@63e37a79f7bd939314997e29c2f5a9f0ef184281" }, { "signature_type": "Function", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c", "function": "gma_crtc_page_flip" }, "digest": { "function_hash": "133231589083785085387079770339147885013", "length": 855.0 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-81ac6055", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a6ed7624bf4d0a32f2631e74828bca7b7bf15afd" }, { "signature_type": "Function", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c", "function": "gma_crtc_page_flip" }, "digest": { "function_hash": "133231589083785085387079770339147885013", "length": 855.0 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-81e0aeb4", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5812807e416618477d1bb0049727ce8bb8292fd" }, { "signature_type": "Line", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c" }, "digest": { "line_hashes": [ "326440798024638431266732621414268041968", "338757558822754854895352904672238490332", "261636347292756436578229651529971811582", "66674566450220555016804516126918483046", "66881723990388709066266615872338351867", "276246483805205850372409357029020122528", "147754690285036704551226725959645938020", "262282139772735274220797524788513791494", "233145116548514954000555965837520107624", "88344231342979707582315202554909704925" ], "threshold": 0.9 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-b9aaae8d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e5ae504c8623476e13032670f1a6d6344d53ec9b" }, { "signature_type": "Line", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c" }, "digest": { "line_hashes": [ "326440798024638431266732621414268041968", "338757558822754854895352904672238490332", "261636347292756436578229651529971811582", "66674566450220555016804516126918483046", "66881723990388709066266615872338351867", "276246483805205850372409357029020122528", "147754690285036704551226725959645938020", "262282139772735274220797524788513791494", "233145116548514954000555965837520107624", "88344231342979707582315202554909704925" ], "threshold": 0.9 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-cd02a991", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@63e37a79f7bd939314997e29c2f5a9f0ef184281" }, { "signature_type": "Line", "target": { "file": "drivers/gpu/drm/gma500/gma_display.c" }, "digest": { "line_hashes": [ "326440798024638431266732621414268041968", "338757558822754854895352904672238490332", "261636347292756436578229651529971811582", "66674566450220555016804516126918483046", "66881723990388709066266615872338351867", "276246483805205850372409357029020122528", "147754690285036704551226725959645938020", "262282139772735274220797524788513791494", "233145116548514954000555965837520107624", "88344231342979707582315202554909704925" ], "threshold": 0.9 }, "signature_version": "v1", "deprecated": false, "id": "CVE-2022-48634-dbe7c8ca", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5812807e416618477d1bb0049727ce8bb8292fd" } ] }