CVE-2022-50261

Source
https://cve.org/CVERecord?id=CVE-2022-50261
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50261.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-50261
Downstream
Related
Published
2025-09-15T14:03:04.439Z
Modified
2026-03-20T11:47:20.611216Z
Summary
drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
Details

In the Linux kernel, the following vulnerability has been resolved:

drm/sti: Fix return type of sti_{dvo,hda,hdmi}connectormode_valid()

With clang's kernel control flow integrity (kCFI, CONFIGCFICLANG), indirect call targets are validated against the expected function pointer prototype to make sure the call target is valid to help mitigate ROP attacks. If they are not identical, there is a failure at run time, which manifests as either a kernel panic or thread getting killed. A proposed warning in clang aims to catch these at compile time, which reveals:

drivers/gpu/drm/sti/stihda.c:637:16: error: incompatible function pointer types initializing 'enum drmmodestatus (*)(struct drmconnector *, struct drmdisplaymode *)' with an expression of type 'int (struct drmconnector *, struct drmdisplaymode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .modevalid = stihdaconnectormodevalid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/sti/stidvo.c:376:16: error: incompatible function pointer types initializing 'enum drmmodestatus (*)(struct drmconnector *, struct drmdisplaymode *)' with an expression of type 'int (struct drmconnector *, struct drmdisplaymode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .modevalid = stidvoconnectormodevalid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/sti/stihdmi.c:1035:16: error: incompatible function pointer types initializing 'enum drmmodestatus (*)(struct drmconnector *, struct drmdisplaymode *)' with an expression of type 'int (struct drmconnector *, struct drmdisplaymode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .modevalid = stihdmiconnectormodevalid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

->modevalid() in 'struct drmconnectorhelperfuncs' expects a return type of 'enum drmmodestatus', not 'int'. Adjust the return type of sti_{dvo,hda,hdmi}connectormode_valid() to match the prototype's to resolve the warning and CFI failure.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50261.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5402626c83a2f19da14859e2bab231a53e16ee74
Fixed
b2c92b2a3801b09b709cbefd9a9e4944b72400bf
Fixed
b4307c7d35e346b909edfdc1f280902150570bb6
Fixed
8f9941dea3a70b73f2063f9dcc4aaae6af03c5ba
Fixed
511b48ee8e4aec2d03d2af06b363d9eb3230b017
Fixed
6e3c4d3fa5d458d685561ecbaf8daa9dba14979e
Fixed
a075c21ee026f4a74f9fce5928ea3c8d18a8af13
Fixed
e578b0906b6a81479cd5b5b6c848a7096addf5e9
Fixed
04371a75a58422a301a9ff9ae3babd310ac3bb3f
Fixed
0ad811cc08a937d875cbad0149c1bab17f84ba05

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50261.json"