In the Linux kernel, the following vulnerability has been resolved:
fbdev: Fix unregistering of framebuffers without device
OF framebuffers do not have an underlying device in the Linux device hierarchy. Do a regular unregister call instead of hot unplugging such a non-existing device. Fixes a NULL dereference. An example error message on ppc64le is shown below.
BUG: Kernel NULL pointer dereference on read at 0x00000060 Faulting instruction address: 0xc00000000080dfa4 Oops: Kernel access of bad area, sig: 11 [#1] LE PAGESIZE=64K MMU=Hash SMP NRCPUS=2048 NUMA pSeries [...] CPU: 2 PID: 139 Comm: systemd-udevd Not tainted 5.17.0-ae085d7f9365 #1 NIP: c00000000080dfa4 LR: c00000000080df9c CTR: c000000000797430 REGS: c000000004132fe0 TRAP: 0300 Not tainted (5.17.0-ae085d7f9365) MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 28228282 XER: 20000000 CFAR: c00000000000c80c DAR: 0000000000000060 DSISR: 40000000 IRQMASK: 0 GPR00: c00000000080df9c c000000004133280 c00000000169d200 0000000000000029 GPR04: 00000000ffffefff c000000004132f90 c000000004132f88 0000000000000000 GPR08: c0000000015658f8 c0000000015cd200 c0000000014f57d0 0000000048228283 GPR12: 0000000000000000 c00000003fffe300 0000000020000000 0000000000000000 GPR16: 0000000000000000 0000000113fc4a40 0000000000000005 0000000113fcfb80 GPR20: 000001000f7283b0 0000000000000000 c000000000e4a588 c000000000e4a5b0 GPR24: 0000000000000001 00000000000a0000 c008000000db0168 c0000000021f6ec0 GPR28: c0000000016d65a8 c000000004b36460 0000000000000000 c0000000016d64b0 NIP [c00000000080dfa4] doremoveconflictingframebuffers+0x184/0x1d0 [c000000004133280] [c00000000080df9c] doremoveconflictingframebuffers+0x17c/0x1d0 (unreliable) [c000000004133350] [c00000000080e4d0] removeconflictingframebuffers+0x60/0x150 [c0000000041333a0] [c00000000080e6f4] removeconflictingpciframebuffers+0x134/0x1b0 [c000000004133450] [c008000000e70438] drmapertureremoveconflictingpciframebuffers+0x90/0x100 [drm] [c000000004133490] [c008000000da0ce4] bochspciprobe+0x6c/0xa64 [bochs] [...] [c000000004133db0] [c00000000002aaa0] systemcallexception+0x170/0x2d0 [c000000004133e10] [c00000000000c3cc] systemcallcommon+0xec/0x250
The bug [1] was introduced by commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"). Most firmware framebuffers have an underlying platform device, which can be hot-unplugged before loading the native graphics driver. OF framebuffers do not (yet) have that device. Fix the code by unregistering the framebuffer as before without a hot unplug.
Tested with 5.17 on qemu ppc64le emulation.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f525289ff0ddeb380813bd81e0f9bdaaa1c9078",
"target": {
"function": "do_remove_conflicting_framebuffers",
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "110680003049819475106851452107316358848",
"length": 739.0
},
"id": "CVE-2022-49070-12213dcb",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2388f826cdc9af2651991adc0feb79de9bdf2232",
"target": {
"function": "do_remove_conflicting_framebuffers",
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "110680003049819475106851452107316358848",
"length": 739.0
},
"id": "CVE-2022-49070-328b4ae9",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@feed87ff122b1640c221d4dd559442ab2cd50bb1",
"target": {
"function": "do_remove_conflicting_framebuffers",
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "110680003049819475106851452107316358848",
"length": 739.0
},
"id": "CVE-2022-49070-9f52c8ad",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2388f826cdc9af2651991adc0feb79de9bdf2232",
"target": {
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"112019731791703590661421673761718644657",
"28340330553574970111357445878230904454",
"252216177039328829196746792797177152904",
"201114723858566113025206762383279739470"
],
"threshold": 0.9
},
"id": "CVE-2022-49070-b8849233",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@feed87ff122b1640c221d4dd559442ab2cd50bb1",
"target": {
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"112019731791703590661421673761718644657",
"28340330553574970111357445878230904454",
"252216177039328829196746792797177152904",
"201114723858566113025206762383279739470"
],
"threshold": 0.9
},
"id": "CVE-2022-49070-bbd8fc78",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f525289ff0ddeb380813bd81e0f9bdaaa1c9078",
"target": {
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"112019731791703590661421673761718644657",
"28340330553574970111357445878230904454",
"252216177039328829196746792797177152904",
"201114723858566113025206762383279739470"
],
"threshold": 0.9
},
"id": "CVE-2022-49070-cc076d73",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de33df481545974ba47c46f05194e769e4307843",
"target": {
"function": "do_remove_conflicting_framebuffers",
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Function",
"deprecated": false,
"digest": {
"function_hash": "110680003049819475106851452107316358848",
"length": 739.0
},
"id": "CVE-2022-49070-e87d9a1d",
"signature_version": "v1"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de33df481545974ba47c46f05194e769e4307843",
"target": {
"file": "drivers/video/fbdev/core/fbmem.c"
},
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"112019731791703590661421673761718644657",
"28340330553574970111357445878230904454",
"252216177039328829196746792797177152904",
"201114723858566113025206762383279739470"
],
"threshold": 0.9
},
"id": "CVE-2022-49070-f5ed6f5e",
"signature_version": "v1"
}
]