In the Linux kernel, the following vulnerability has been resolved:
drm/sti: Fix return type of sti{dvo,hda,hdmi}connectormodevalid()
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 drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .mode_valid = sti_hda_connector_mode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/sti/sti_dvo.c:376:16: error: incompatible function pointer types initializing 'enum drm_mode_status ()(struct drmconnector *, struct drmdisplaymode *)' with an expression of type 'int (struct drmconnector , struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .mode_valid = sti_dvo_connector_mode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/sti/sti_hdmi.c:1035:16: error: incompatible function pointer types initializing 'enum drm_mode_status ()(struct drmconnector *, struct drmdisplaymode *)' with an expression of type 'int (struct drmconnector *, struct drmdisplaymode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .modevalid = stihdmiconnectormode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
->modevalid() in 'struct drmconnectorhelperfuncs' expects a return type of 'enum drmmodestatus', not 'int'. Adjust the return type of sti{dvo,hda,hdmi}connectormodevalid() to match the prototype's to resolve the warning and CFI failure.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@511b48ee8e4aec2d03d2af06b363d9eb3230b017",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-2345dffa",
"deprecated": false,
"digest": {
"line_hashes": [
"319669449910737263653972101686039744304",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4307c7d35e346b909edfdc1f280902150570bb6",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-415ba2e8",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@04371a75a58422a301a9ff9ae3babd310ac3bb3f",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-4a3ab967",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a075c21ee026f4a74f9fce5928ea3c8d18a8af13",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-55c6b19d",
"deprecated": false,
"digest": {
"line_hashes": [
"155304433704370801560849462479243397897",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e578b0906b6a81479cd5b5b6c848a7096addf5e9",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-5b89a685",
"deprecated": false,
"digest": {
"line_hashes": [
"155304433704370801560849462479243397897",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0ad811cc08a937d875cbad0149c1bab17f84ba05",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-5e35f236",
"deprecated": false,
"digest": {
"line_hashes": [
"155304433704370801560849462479243397897",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f9941dea3a70b73f2063f9dcc4aaae6af03c5ba",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-71e47868",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0ad811cc08a937d875cbad0149c1bab17f84ba05",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-7c540779",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2c92b2a3801b09b709cbefd9a9e4944b72400bf",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-7cfbce73",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0ad811cc08a937d875cbad0149c1bab17f84ba05",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-7f238612",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2c92b2a3801b09b709cbefd9a9e4944b72400bf",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-7f9874a2",
"deprecated": false,
"digest": {
"line_hashes": [
"193275182264651080176519304600668272041",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6e3c4d3fa5d458d685561ecbaf8daa9dba14979e",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-83c40c86",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e578b0906b6a81479cd5b5b6c848a7096addf5e9",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-861e05c6",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@04371a75a58422a301a9ff9ae3babd310ac3bb3f",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-8c5fc7b6",
"deprecated": false,
"digest": {
"line_hashes": [
"155304433704370801560849462479243397897",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a075c21ee026f4a74f9fce5928ea3c8d18a8af13",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-950de5a3",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e578b0906b6a81479cd5b5b6c848a7096addf5e9",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-95100468",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f9941dea3a70b73f2063f9dcc4aaae6af03c5ba",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-a6467a21",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2c92b2a3801b09b709cbefd9a9e4944b72400bf",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-ac28e941",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6e3c4d3fa5d458d685561ecbaf8daa9dba14979e",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-b12b164d",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6e3c4d3fa5d458d685561ecbaf8daa9dba14979e",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-b212ffb1",
"deprecated": false,
"digest": {
"line_hashes": [
"155304433704370801560849462479243397897",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4307c7d35e346b909edfdc1f280902150570bb6",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-c2c47ba8",
"deprecated": false,
"digest": {
"line_hashes": [
"193275182264651080176519304600668272041",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f9941dea3a70b73f2063f9dcc4aaae6af03c5ba",
"target": {
"file": "drivers/gpu/drm/sti/sti_dvo.c"
},
"id": "CVE-2022-50261-cbc3a6f8",
"deprecated": false,
"digest": {
"line_hashes": [
"193275182264651080176519304600668272041",
"20762416052935080612608302301725589202",
"270932308062164692599460144468604530840",
"24806678261314676129507390745827231625",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@511b48ee8e4aec2d03d2af06b363d9eb3230b017",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-dbf5ac48",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4307c7d35e346b909edfdc1f280902150570bb6",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-e12dcb33",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a075c21ee026f4a74f9fce5928ea3c8d18a8af13",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-ebdc5583",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@04371a75a58422a301a9ff9ae3babd310ac3bb3f",
"target": {
"file": "drivers/gpu/drm/sti/sti_hdmi.c"
},
"id": "CVE-2022-50261-ecc1ab97",
"deprecated": false,
"digest": {
"line_hashes": [
"187948120605191765263148161272498001182",
"187231637971402488119607515717004975686",
"52535957113618590122203538187086542743",
"100455602792426047942552063185005448243",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@511b48ee8e4aec2d03d2af06b363d9eb3230b017",
"target": {
"file": "drivers/gpu/drm/sti/sti_hda.c"
},
"id": "CVE-2022-50261-faaf99e5",
"deprecated": false,
"digest": {
"line_hashes": [
"32199064881896384731703931642377979468",
"269635713151131829300104786268207802409",
"170803483699485302134221848199375519267",
"95884026895062252503380736869422043950",
"65518648297289824207808688162824794115"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
}
]