In the Linux kernel, the following vulnerability has been resolved:
bpf, lsm: Add check for BPF LSM return value
A bpf prog returning a positive number attached to fileallocsecurity hook makes kernel panic.
This happens because file system can not filter out the positive number returned by the LSM prog using IS_ERR, and misinterprets this positive number as a file pointer.
Given that hook fileallocsecurity never returned positive number before the introduction of BPF LSM, and other BPF LSM hooks may encounter similar issues, this patch adds LSM return value check in verifier, to ensure no unexpected value is returned.
[
{
"id": "CVE-2024-47703-07261e41",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "228607494978111819315163388322219770074",
"length": 6191.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_mem_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-1d522b0d",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"187587727666198352741207014292750290153",
"166720278087098071717577836779537748700",
"125627702556611590777610762614508463573",
"315902037586254474414089536584215750373",
"253345642152753680758365201018297150154"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/bpf_lsm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-2408e6ed",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"44307539166232301248160239171706982110",
"122045890282823780718371220423139034324",
"134513523131799167091981313200107729571",
"183066736256943368714327259878256931",
"287117526435793158201557177889718982410",
"171424897043918254694126625162894873961",
"114703080927343391965366478448354408381",
"324616885819118083693666484052439449607"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf_lsm.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-3d0d4f9b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "2423282382998806881674659812369362897",
"length": 778.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-507a65fd",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"44307539166232301248160239171706982110",
"122045890282823780718371220423139034324",
"134513523131799167091981313200107729571",
"183066736256943368714327259878256931",
"287117526435793158201557177889718982410",
"171424897043918254694126625162894873961",
"114703080927343391965366478448354408381",
"324616885819118083693666484052439449607"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf_lsm.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-5e26761f",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "2423282382998806881674659812369362897",
"length": 778.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-687c7f9c",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"162705809624952394969235251470030272557",
"58998075385498872160356615690144166901",
"78384224105024848109273277023606175153",
"281376102789211019964199578504828207595",
"310043095710147721062387988753768002744"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/btf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-6ad373a9",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"96901455982240113475157111339280812787",
"107568251022592370636580769145433564525",
"261853410154104906591617026417427594452",
"172067861108013962947654597253435800276"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-6e304c85",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "228607494978111819315163388322219770074",
"length": 6191.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_mem_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-71fdbcd4",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"187587727666198352741207014292750290153",
"166720278087098071717577836779537748700",
"125627702556611590777610762614508463573",
"315902037586254474414089536584215750373",
"253345642152753680758365201018297150154"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/bpf_lsm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-740de84d",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"277691530577686173810569181310347843379",
"101224294888024417884054528672421107927",
"182714459227421268419789113038175449431",
"289141334213384653841788564036347297440",
"70348894209358287795649571727337414670",
"205027044590486302407025071427258678969",
"6359469917545470633194120403105421400",
"14220072202940059569038907319916004007",
"45165098322783160131751645388114203872",
"165038764379696214912721724364317926509",
"230157584827832681685805696813075551740",
"142772483845840228604064054560677914310",
"1412777350667465610958973281338721016",
"196286138656184504668895709033010168034",
"92993436341675739450050225646142025057",
"180941966250781457435810300503761790509",
"326046333330852493515847627541324146379",
"181279515857866499701508199519782850706",
"312953998375935326699347020418619902918",
"307101937873956211427503002469449328080",
"61684479951118056646231522779784655276",
"215116812753618774043095277688970497007",
"232245946908764391462609424792888371709",
"209483331065132183181091913892420692284",
"316502079330273836706023829391525235866",
"280428175290085830447725591247175867391",
"182244846700537661106388496280208409374",
"49298059036238124389773990095292205943",
"244837786572410655071654077092208696110",
"237092238210501615319767609656452419925",
"106839435195874979366249588626629631496",
"60742430699536773116838417393863336582",
"75452608942310912248586437123319154849",
"25760339952119841875338500621073297126",
"111946600846903400834350093749655551534",
"288945799938837518347164374112306044532"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/verifier.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-7a1b6d26",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"162705809624952394969235251470030272557",
"58998075385498872160356615690144166901",
"78384224105024848109273277023606175153",
"281376102789211019964199578504828207595",
"310043095710147721062387988753768002744"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/btf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-7df5575c",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"96901455982240113475157111339280812787",
"107568251022592370636580769145433564525",
"261853410154104906591617026417427594452",
"172067861108013962947654597253435800276"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-86d378cd",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "32990303206997357639275799301076289166",
"length": 3723.0
},
"target": {
"file": "kernel/bpf/btf.c",
"function": "btf_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-93c4769b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "32990303206997357639275799301076289166",
"length": 3723.0
},
"target": {
"file": "kernel/bpf/btf.c",
"function": "btf_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-a1b72fbc",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"96901455982240113475157111339280812787",
"107568251022592370636580769145433564525",
"261853410154104906591617026417427594452",
"172067861108013962947654597253435800276"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-b5986e1b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"277691530577686173810569181310347843379",
"101224294888024417884054528672421107927",
"182714459227421268419789113038175449431",
"289141334213384653841788564036347297440",
"70348894209358287795649571727337414670",
"205027044590486302407025071427258678969",
"6359469917545470633194120403105421400",
"14220072202940059569038907319916004007",
"45165098322783160131751645388114203872",
"165038764379696214912721724364317926509",
"230157584827832681685805696813075551740",
"142772483845840228604064054560677914310",
"1412777350667465610958973281338721016",
"196286138656184504668895709033010168034",
"92993436341675739450050225646142025057",
"180941966250781457435810300503761790509",
"326046333330852493515847627541324146379",
"181279515857866499701508199519782850706",
"312953998375935326699347020418619902918",
"307101937873956211427503002469449328080",
"61684479951118056646231522779784655276",
"215116812753618774043095277688970497007",
"232245946908764391462609424792888371709",
"209483331065132183181091913892420692284",
"316502079330273836706023829391525235866",
"280428175290085830447725591247175867391",
"182244846700537661106388496280208409374",
"49298059036238124389773990095292205943",
"244837786572410655071654077092208696110",
"237092238210501615319767609656452419925",
"106839435195874979366249588626629631496",
"60742430699536773116838417393863336582",
"75452608942310912248586437123319154849",
"25760339952119841875338500621073297126",
"111946600846903400834350093749655551534",
"288945799938837518347164374112306044532"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/verifier.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-b8cfb7d3",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"277691530577686173810569181310347843379",
"101224294888024417884054528672421107927",
"182714459227421268419789113038175449431",
"289141334213384653841788564036347297440",
"70348894209358287795649571727337414670",
"205027044590486302407025071427258678969",
"6359469917545470633194120403105421400",
"14220072202940059569038907319916004007",
"45165098322783160131751645388114203872",
"165038764379696214912721724364317926509",
"230157584827832681685805696813075551740",
"142772483845840228604064054560677914310",
"1412777350667465610958973281338721016",
"196286138656184504668895709033010168034",
"92993436341675739450050225646142025057",
"180941966250781457435810300503761790509",
"326046333330852493515847627541324146379",
"181279515857866499701508199519782850706",
"312953998375935326699347020418619902918",
"307101937873956211427503002469449328080",
"61684479951118056646231522779784655276",
"215116812753618774043095277688970497007",
"232245946908764391462609424792888371709",
"209483331065132183181091913892420692284",
"316502079330273836706023829391525235866",
"280428175290085830447725591247175867391",
"182244846700537661106388496280208409374",
"49298059036238124389773990095292205943",
"244837786572410655071654077092208696110",
"237092238210501615319767609656452419925",
"106839435195874979366249588626629631496",
"60742430699536773116838417393863336582",
"75452608942310912248586437123319154849",
"25760339952119841875338500621073297126",
"111946600846903400834350093749655551534",
"288945799938837518347164374112306044532"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/verifier.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-b8dd4093",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "287028657448474014564617390981218537782",
"length": 4031.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_return_code"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-cfafbd1d",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "32990303206997357639275799301076289166",
"length": 3723.0
},
"target": {
"file": "kernel/bpf/btf.c",
"function": "btf_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-cff70c51",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "2423282382998806881674659812369362897",
"length": 778.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_ctx_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-d0224d99",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "287028657448474014564617390981218537782",
"length": 4031.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_return_code"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-d5efbe6b",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"44307539166232301248160239171706982110",
"122045890282823780718371220423139034324",
"134513523131799167091981313200107729571",
"183066736256943368714327259878256931",
"287117526435793158201557177889718982410",
"171424897043918254694126625162894873961",
"114703080927343391965366478448354408381",
"324616885819118083693666484052439449607"
],
"threshold": 0.9
},
"target": {
"file": "include/linux/bpf_lsm.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-df7d32c4",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"187587727666198352741207014292750290153",
"166720278087098071717577836779537748700",
"125627702556611590777610762614508463573",
"315902037586254474414089536584215750373",
"253345642152753680758365201018297150154"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/bpf_lsm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
},
{
"id": "CVE-2024-47703-eb8fe4a2",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "287028657448474014564617390981218537782",
"length": 4031.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_return_code"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27ca3e20fe80be85a92b10064dfeb56cb2564b1c"
},
{
"id": "CVE-2024-47703-ec1b4baf",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "228607494978111819315163388322219770074",
"length": 6191.0
},
"target": {
"file": "kernel/bpf/verifier.c",
"function": "check_mem_access"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1050727d83e70449991c29dd1cf29fe936a63da3"
},
{
"id": "CVE-2024-47703-fa4477fc",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"162705809624952394969235251470030272557",
"58998075385498872160356615690144166901",
"78384224105024848109273277023606175153",
"281376102789211019964199578504828207595",
"310043095710147721062387988753768002744"
],
"threshold": 0.9
},
"target": {
"file": "kernel/bpf/btf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d99e198be279045e6ecefe220f5c52f8ce9bfd5"
}
]