In the Linux kernel, the following vulnerability has been resolved:
fpga: region: add owner module and take its refcount
The current implementation of the fpga region assumes that the low-level module registers a driver for the parent device and uses its owner pointer to take the module's refcount. This approach is problematic since it can lead to a null pointer dereference while attempting to get the region during programming if the parent device does not have a driver.
To address this problem, add a module owner pointer to the fpga_region struct and use it to take the module's refcount. Modify the functions for registering a region to take an additional owner module parameter and rename them to avoid conflicts. Use the old function names for helper macros that automatically set the module that registers the region as the owner. This ensures compatibility with existing low-level control modules and reduces the chances of registering a region without setting the owner.
Also, update the documentation to keep it consistent with the new interface for registering an fpga region.
[
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_put"
},
"digest": {
"length": 202.0,
"function_hash": "153713451855664761615051285893847128476"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-0dab9f08"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register"
},
"digest": {
"length": 186.0,
"function_hash": "177695948087895998230979435586654004936"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-1de4b645"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register"
},
"digest": {
"length": 186.0,
"function_hash": "177695948087895998230979435586654004936"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-2cc38aaf"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_put"
},
"digest": {
"length": 202.0,
"function_hash": "153713451855664761615051285893847128476"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-42fa895e"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c"
},
"digest": {
"line_hashes": [
"190977248477241844050909598673995101504",
"180618119339131929527092130780194138647",
"339044643064477146243099279482995945913",
"291352598099477036506129829429510064448",
"15612651380634589574580673935900879236",
"214752904406526928395029879768178938908",
"180292823535243988122250753550828995139",
"48843043871365168230911815969790265573",
"43336986188766267399580080680146941385",
"185565899634012316148638195720712116297",
"229126928175611632136662820851743658584",
"21681430096578444217193973660329493990",
"225966561887706055891386955800926218802",
"206145015193258368574855137315095967477",
"155072498147292752782837949931100094415",
"286350469215876842594493344688362280758",
"239617366113148654975907879675632321931",
"99089629145370276056898366780868498955",
"93146847045830071340194302823748348467",
"335257632645001981298598975049112050150",
"326656887138908152583623253467521807627",
"305100377885446109460897025007880920903",
"88075428067244305074488868009843142779",
"84100662672292221095580252709658838958",
"182735725231104344647482513163935858279",
"60540883692071364407019517173572287670",
"284584328826101074027955090802217198077",
"253626571937689129222414622599709152365",
"49260093481145298007964449536836462350",
"79022329288093493972713548876561969682",
"232042708220879393063530726137140077368"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-449f6e1f"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "include/linux/fpga/fpga-region.h"
},
"digest": {
"line_hashes": [
"140780176644210172918727434479531150096",
"26299554785219240398445069933908447473",
"298200092053064775512605052342338339637",
"272229596767025387559243598657043236777",
"258286555310518692967140221842956474821",
"263630932474956120850946026596425616568",
"284706310548470814767313884660719475089",
"205969570805332447391306290534773443665",
"89707913576630171829870930759791168892",
"156126267770458221250134449278648609636",
"312336167141618271102018705567275499402",
"82971500143774673908639279268592813423",
"101088633035500296282509060909419778343",
"88738081008832152570948299479973214030"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-45d42d34"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_get"
},
"digest": {
"length": 420.0,
"function_hash": "99655454611544556402074214674858708406"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-47f31c25"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "include/linux/fpga/fpga-region.h"
},
"digest": {
"line_hashes": [
"140780176644210172918727434479531150096",
"26299554785219240398445069933908447473",
"298200092053064775512605052342338339637",
"272229596767025387559243598657043236777",
"258286555310518692967140221842956474821",
"263630932474956120850946026596425616568",
"284706310548470814767313884660719475089",
"29441155701826601815920103890531234096",
"89707913576630171829870930759791168892",
"156126267770458221250134449278648609636",
"312336167141618271102018705567275499402",
"82971500143774673908639279268592813423",
"101088633035500296282509060909419778343",
"88738081008832152570948299479973214030"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-4de549aa"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register_full"
},
"digest": {
"length": 1072.0,
"function_hash": "119277438619744995077539712519880542256"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-595b1997"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c"
},
"digest": {
"line_hashes": [
"190977248477241844050909598673995101504",
"180618119339131929527092130780194138647",
"339044643064477146243099279482995945913",
"291352598099477036506129829429510064448",
"15612651380634589574580673935900879236",
"214752904406526928395029879768178938908",
"180292823535243988122250753550828995139",
"48843043871365168230911815969790265573",
"43336986188766267399580080680146941385",
"185565899634012316148638195720712116297",
"229126928175611632136662820851743658584",
"21681430096578444217193973660329493990",
"225966561887706055891386955800926218802",
"206145015193258368574855137315095967477",
"155072498147292752782837949931100094415",
"286350469215876842594493344688362280758",
"239617366113148654975907879675632321931",
"99089629145370276056898366780868498955",
"93146847045830071340194302823748348467",
"335257632645001981298598975049112050150",
"326656887138908152583623253467521807627",
"305100377885446109460897025007880920903",
"88075428067244305074488868009843142779",
"84100662672292221095580252709658838958",
"182735725231104344647482513163935858279",
"60540883692071364407019517173572287670",
"284584328826101074027955090802217198077",
"253626571937689129222414622599709152365",
"49260093481145298007964449536836462350",
"79022329288093493972713548876561969682",
"232042708220879393063530726137140077368"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-595fb6be"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register_full"
},
"digest": {
"length": 1078.0,
"function_hash": "125825149824360907767069066526963388078"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-59824a0c"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_put"
},
"digest": {
"length": 202.0,
"function_hash": "153713451855664761615051285893847128476"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-655c0bc4"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_get"
},
"digest": {
"length": 420.0,
"function_hash": "99655454611544556402074214674858708406"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-7940393c"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c"
},
"digest": {
"line_hashes": [
"190977248477241844050909598673995101504",
"180618119339131929527092130780194138647",
"339044643064477146243099279482995945913",
"291352598099477036506129829429510064448",
"15612651380634589574580673935900879236",
"214752904406526928395029879768178938908",
"180292823535243988122250753550828995139",
"48843043871365168230911815969790265573",
"43336986188766267399580080680146941385",
"185565899634012316148638195720712116297",
"229126928175611632136662820851743658584",
"21681430096578444217193973660329493990",
"225966561887706055891386955800926218802",
"206145015193258368574855137315095967477",
"155072498147292752782837949931100094415",
"286350469215876842594493344688362280758",
"337714906058003099586814834611527446062",
"99089629145370276056898366780868498955",
"93146847045830071340194302823748348467",
"335257632645001981298598975049112050150",
"326656887138908152583623253467521807627",
"305100377885446109460897025007880920903",
"88075428067244305074488868009843142779",
"84100662672292221095580252709658838958",
"182735725231104344647482513163935858279",
"60540883692071364407019517173572287670",
"284584328826101074027955090802217198077",
"253626571937689129222414622599709152365",
"49260093481145298007964449536836462350",
"79022329288093493972713548876561969682",
"232042708220879393063530726137140077368"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-7ebf16e9"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_get"
},
"digest": {
"length": 420.0,
"function_hash": "99655454611544556402074214674858708406"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-8194d49d"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register"
},
"digest": {
"length": 186.0,
"function_hash": "177695948087895998230979435586654004936"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-8931d495"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register_full"
},
"digest": {
"length": 1078.0,
"function_hash": "125825149824360907767069066526963388078"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-8b0fb5d9"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_put"
},
"digest": {
"length": 202.0,
"function_hash": "153713451855664761615051285893847128476"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-aad73a07"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "include/linux/fpga/fpga-region.h"
},
"digest": {
"line_hashes": [
"140780176644210172918727434479531150096",
"26299554785219240398445069933908447473",
"298200092053064775512605052342338339637",
"272229596767025387559243598657043236777",
"258286555310518692967140221842956474821",
"263630932474956120850946026596425616568",
"284706310548470814767313884660719475089",
"29441155701826601815920103890531234096",
"89707913576630171829870930759791168892",
"156126267770458221250134449278648609636",
"312336167141618271102018705567275499402",
"82971500143774673908639279268592813423",
"101088633035500296282509060909419778343",
"88738081008832152570948299479973214030"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-ae518e4b"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register"
},
"digest": {
"length": 186.0,
"function_hash": "177695948087895998230979435586654004936"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-b0b2189f"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c"
},
"digest": {
"line_hashes": [
"190977248477241844050909598673995101504",
"180618119339131929527092130780194138647",
"339044643064477146243099279482995945913",
"291352598099477036506129829429510064448",
"15612651380634589574580673935900879236",
"214752904406526928395029879768178938908",
"180292823535243988122250753550828995139",
"48843043871365168230911815969790265573",
"43336986188766267399580080680146941385",
"185565899634012316148638195720712116297",
"229126928175611632136662820851743658584",
"21681430096578444217193973660329493990",
"225966561887706055891386955800926218802",
"206145015193258368574855137315095967477",
"155072498147292752782837949931100094415",
"286350469215876842594493344688362280758",
"239617366113148654975907879675632321931",
"99089629145370276056898366780868498955",
"93146847045830071340194302823748348467",
"335257632645001981298598975049112050150",
"326656887138908152583623253467521807627",
"305100377885446109460897025007880920903",
"88075428067244305074488868009843142779",
"84100662672292221095580252709658838958",
"182735725231104344647482513163935858279",
"60540883692071364407019517173572287670",
"284584328826101074027955090802217198077",
"253626571937689129222414622599709152365",
"49260093481145298007964449536836462350",
"79022329288093493972713548876561969682",
"232042708220879393063530726137140077368"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-bea8fe85"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register_full"
},
"digest": {
"length": 1072.0,
"function_hash": "119277438619744995077539712519880542256"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d7d12b643c00e7eea51b49a60a2ead182633ec8",
"signature_version": "v1",
"id": "CVE-2024-35247-c5e9ba71"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_get"
},
"digest": {
"length": 420.0,
"function_hash": "99655454611544556402074214674858708406"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-c6e60a43"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "include/linux/fpga/fpga-region.h"
},
"digest": {
"line_hashes": [
"140780176644210172918727434479531150096",
"26299554785219240398445069933908447473",
"298200092053064775512605052342338339637",
"272229596767025387559243598657043236777",
"258286555310518692967140221842956474821",
"263630932474956120850946026596425616568",
"284706310548470814767313884660719475089",
"29441155701826601815920103890531234096",
"89707913576630171829870930759791168892",
"156126267770458221250134449278648609636",
"312336167141618271102018705567275499402",
"82971500143774673908639279268592813423",
"101088633035500296282509060909419778343",
"88738081008832152570948299479973214030"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-c9f68b9a"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register_full"
},
"digest": {
"length": 1072.0,
"function_hash": "119277438619744995077539712519880542256"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2279c09c36165ccded4d506d11a7714e13b56019",
"signature_version": "v1",
"id": "CVE-2024-35247-cd4f2ae1"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_put"
},
"digest": {
"length": 202.0,
"function_hash": "153713451855664761615051285893847128476"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7c0e1ecee403a43abc89eb3e75672b01ff2ece9",
"signature_version": "v1",
"id": "CVE-2024-35247-d4ac46ce"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "include/linux/fpga/fpga-region.h"
},
"digest": {
"line_hashes": [
"140780176644210172918727434479531150096",
"26299554785219240398445069933908447473",
"298200092053064775512605052342338339637",
"272229596767025387559243598657043236777",
"258286555310518692967140221842956474821",
"263630932474956120850946026596425616568",
"284706310548470814767313884660719475089",
"205969570805332447391306290534773443665",
"89707913576630171829870930759791168892",
"156126267770458221250134449278648609636",
"312336167141618271102018705567275499402",
"82971500143774673908639279268592813423",
"101088633035500296282509060909419778343",
"88738081008832152570948299479973214030"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b4eee8572dcf82b2ed17d9a328c7fb87df2f0e8",
"signature_version": "v1",
"id": "CVE-2024-35247-e3cbf959"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c"
},
"digest": {
"line_hashes": [
"190977248477241844050909598673995101504",
"180618119339131929527092130780194138647",
"339044643064477146243099279482995945913",
"291352598099477036506129829429510064448",
"15612651380634589574580673935900879236",
"214752904406526928395029879768178938908",
"180292823535243988122250753550828995139",
"48843043871365168230911815969790265573",
"43336986188766267399580080680146941385",
"185565899634012316148638195720712116297",
"229126928175611632136662820851743658584",
"21681430096578444217193973660329493990",
"225966561887706055891386955800926218802",
"206145015193258368574855137315095967477",
"155072498147292752782837949931100094415",
"286350469215876842594493344688362280758",
"337714906058003099586814834611527446062",
"99089629145370276056898366780868498955",
"93146847045830071340194302823748348467",
"335257632645001981298598975049112050150",
"326656887138908152583623253467521807627",
"305100377885446109460897025007880920903",
"88075428067244305074488868009843142779",
"84100662672292221095580252709658838958",
"182735725231104344647482513163935858279",
"60540883692071364407019517173572287670",
"284584328826101074027955090802217198077",
"253626571937689129222414622599709152365",
"49260093481145298007964449536836462350",
"79022329288093493972713548876561969682",
"232042708220879393063530726137140077368"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-e9952e41"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_register"
},
"digest": {
"length": 186.0,
"function_hash": "177695948087895998230979435586654004936"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-f4f0a6c4"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/fpga/fpga-region.c",
"function": "fpga_region_get"
},
"digest": {
"length": 420.0,
"function_hash": "99655454611544556402074214674858708406"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26e6e25d742e29885cf44274fcf6b744366c4702",
"signature_version": "v1",
"id": "CVE-2024-35247-ff9210f3"
}
]