In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: do not defer rule destruction via callrcu
nftableschaindestroy can sleep, it can't be used from callrcu callbacks.
Moreover, nftablesrulerelease() is only safe for error unwinding, while transaction mutex is held and the to-be-desroyed rule was not exposed to either dataplane or dumps, as it deactives+frees without the required synchronizercu() in-between.
nftruleexprdeactivate() callbacks will change ->use counters of other chains/sets, see e.g. nftlookup .deactivate callback, these must be serialized via transaction mutex.
Also add a few lockdep asserts to make this more explicit.
Calling synchronize_rcu() isn't ideal, but fixing this without is hard and way more intrusive. As-is, we can get:
WARNING: .. net/netfilter/nftablesapi.c:5515 nftsetdestroy+0x.. Workqueue: events nftablestransdestroywork RIP: 0010:nftsetdestroy+0x3fe/0x5c0 Call Trace: <TASK> nftablestransdestroywork+0x6b7/0xad0 processonework+0x64a/0xce0 worker_thread+0x613/0x10d0
In case the synchronize_rcu becomes an issue, we can explore alternatives.
One way would be to allocate nfttransrule objects + one nfttranschain object, deactivate the rules + the chain and then defer the freeing to the nft destroy workqueue. We'd still need to keep the synchronize_rcu path as a fallback to handle -ENOMEM corner cases though.
[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 796.0,
"function_hash": "58062093416808777897363177089339855071"
},
"id": "CVE-2024-56655-014b7773",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_deactivate_set"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 495.0,
"function_hash": "250472909207345825984220206147070222612"
},
"id": "CVE-2024-56655-1a54c6fb",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "__nft_release_basechain"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 292.0,
"function_hash": "124195095067184910825024787766240872263"
},
"id": "CVE-2024-56655-2a4f1cdd",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nft_release_basechain_rcu"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 143.0,
"function_hash": "284304899288686065268980947528217775515"
},
"id": "CVE-2024-56655-2c75eb0a",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_rule_release"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 292.0,
"function_hash": "124195095067184910825024787766240872263"
},
"id": "CVE-2024-56655-334a1c65",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nft_release_basechain_rcu"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 796.0,
"function_hash": "58062093416808777897363177089339855071"
},
"id": "CVE-2024-56655-370adb5c",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_deactivate_set"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 495.0,
"function_hash": "250472909207345825984220206147070222612"
},
"id": "CVE-2024-56655-475629c5",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "__nft_release_basechain"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 292.0,
"function_hash": "124195095067184910825024787766240872263"
},
"id": "CVE-2024-56655-4c51f8cb",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nft_release_basechain_rcu"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 782.0,
"function_hash": "159425857658854293461810954580294351245"
},
"id": "CVE-2024-56655-59ce45ef",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_deactivate_set"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"123656555542263724085958814027993865141",
"273363564856853663435733929062221314841",
"122578833396545997839555350669039804450",
"269963360065794686296702709131467937222",
"179903893833450110735920806261827194025",
"278939166972522970546382326302296458905",
"17096592994196017974281977204073931400",
"59990617408768272502547209292952109316",
"239120332530624416012246903427945667627",
"55901828066873821376347685396052800879",
"4870713759330099550194795482081273599",
"336386893149348823663135939983859293749",
"169093262534579363666978042604587143426",
"294188687614261705875978785642108470734"
]
},
"id": "CVE-2024-56655-5ec98293",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "include/net/netfilter/nf_tables.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52406798831249034605657372461205896965",
"321108354501734323475322641513867528096",
"218572727371677532168831596406036492977",
"37198097376715911361551572996914531627",
"314899792593679965403968063375833842941",
"313896647953449685336850552776041582524",
"27704813292231614195800743398505851567",
"223379006704289451406926268871222683766",
"321520053814714824168807307146187416995",
"117675707067085739469112169527070604754",
"332440699730513737737695324707135130294",
"120494707681717025646948723997776007226",
"94795260559170949538434461726082883871",
"78335275065957410634056665558099574834",
"300553542072646544790680618229113134188",
"101401628667189320353015141879466327551",
"182607065142963335258256663945557257563",
"162196525398974483869148880842360852210",
"141417512434365936128919629679731654138",
"175568739473185788754912992593484359941",
"134078567056960269972350917448934999023",
"189799065523441952458837486369763376019",
"318535004141185768118760270071327589446",
"52364435625609516066046454847205123108",
"155362949980990934420131990365083830985",
"319761102844646045482496609287095602986",
"65949466065408728842310486894100929091",
"262741019422917581553372103753746614023",
"14185005923845372111472456293710192755",
"285431062864621941694139087002696920239",
"211698840922933891344532990994108485313",
"173307191214505129898373649875476725787",
"101100681456993514427147901917584293083",
"329233171682136690454130720936347826648"
]
},
"id": "CVE-2024-56655-62b8a262",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "net/netfilter/nf_tables_api.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 495.0,
"function_hash": "250472909207345825984220206147070222612"
},
"id": "CVE-2024-56655-71645ca6",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "__nft_release_basechain"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 292.0,
"function_hash": "124195095067184910825024787766240872263"
},
"id": "CVE-2024-56655-7c82da3c",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nft_release_basechain_rcu"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 143.0,
"function_hash": "284304899288686065268980947528217775515"
},
"id": "CVE-2024-56655-81c60960",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_rule_release"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 495.0,
"function_hash": "250472909207345825984220206147070222612"
},
"id": "CVE-2024-56655-8785bec0",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "__nft_release_basechain"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52406798831249034605657372461205896965",
"321108354501734323475322641513867528096",
"218572727371677532168831596406036492977",
"329732343816231437194487918387315704435",
"314899792593679965403968063375833842941",
"313896647953449685336850552776041582524",
"27704813292231614195800743398505851567",
"223379006704289451406926268871222683766",
"321520053814714824168807307146187416995",
"117675707067085739469112169527070604754",
"332440699730513737737695324707135130294",
"120494707681717025646948723997776007226",
"94795260559170949538434461726082883871",
"78335275065957410634056665558099574834",
"300553542072646544790680618229113134188",
"101401628667189320353015141879466327551",
"182607065142963335258256663945557257563",
"162196525398974483869148880842360852210",
"141417512434365936128919629679731654138",
"175568739473185788754912992593484359941",
"134078567056960269972350917448934999023",
"189799065523441952458837486369763376019",
"318535004141185768118760270071327589446",
"52364435625609516066046454847205123108",
"155362949980990934420131990365083830985",
"319761102844646045482496609287095602986",
"65949466065408728842310486894100929091",
"262741019422917581553372103753746614023",
"14185005923845372111472456293710192755",
"285431062864621941694139087002696920239",
"211698840922933891344532990994108485313",
"173307191214505129898373649875476725787",
"101100681456993514427147901917584293083",
"329233171682136690454130720936347826648"
]
},
"id": "CVE-2024-56655-907d133d",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "net/netfilter/nf_tables_api.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"269963360065794686296702709131467937222",
"179903893833450110735920806261827194025",
"278939166972522970546382326302296458905",
"17096592994196017974281977204073931400",
"59990617408768272502547209292952109316",
"239120332530624416012246903427945667627",
"55901828066873821376347685396052800879",
"4870713759330099550194795482081273599",
"336386893149348823663135939983859293749",
"169093262534579363666978042604587143426",
"294188687614261705875978785642108470734"
]
},
"id": "CVE-2024-56655-949b394e",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "include/net/netfilter/nf_tables.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"269963360065794686296702709131467937222",
"150498357864209277026302609521669189180",
"6114811061827227593994324218899275418",
"114594612686224112714944060398158116251",
"59990617408768272502547209292952109316",
"239120332530624416012246903427945667627",
"55901828066873821376347685396052800879",
"4870713759330099550194795482081273599",
"336386893149348823663135939983859293749",
"169093262534579363666978042604587143426",
"294188687614261705875978785642108470734"
]
},
"id": "CVE-2024-56655-972dd4cb",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "include/net/netfilter/nf_tables.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"46546423754659426397356662660788400004",
"159917352393604276802215079920043383876",
"179363077164943807625374986440112112968",
"114594612686224112714944060398158116251",
"59990617408768272502547209292952109316",
"239120332530624416012246903427945667627",
"55901828066873821376347685396052800879",
"4870713759330099550194795482081273599",
"336386893149348823663135939983859293749",
"169093262534579363666978042604587143426",
"294188687614261705875978785642108470734"
]
},
"id": "CVE-2024-56655-9958e69e",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "include/net/netfilter/nf_tables.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52406798831249034605657372461205896965",
"321108354501734323475322641513867528096",
"218572727371677532168831596406036492977",
"37198097376715911361551572996914531627",
"158550191547843472374521285206216541256",
"75609071697352611965074985054119874044",
"276048578277071645342013180492511332547",
"321520053814714824168807307146187416995",
"117675707067085739469112169527070604754",
"332440699730513737737695324707135130294",
"120494707681717025646948723997776007226",
"94795260559170949538434461726082883871",
"78335275065957410634056665558099574834",
"300553542072646544790680618229113134188",
"101401628667189320353015141879466327551",
"182607065142963335258256663945557257563",
"162196525398974483869148880842360852210",
"141417512434365936128919629679731654138",
"175568739473185788754912992593484359941",
"134078567056960269972350917448934999023",
"189799065523441952458837486369763376019",
"318535004141185768118760270071327589446",
"52364435625609516066046454847205123108",
"155362949980990934420131990365083830985",
"319761102844646045482496609287095602986",
"65949466065408728842310486894100929091",
"262741019422917581553372103753746614023",
"14185005923845372111472456293710192755",
"285431062864621941694139087002696920239",
"211698840922933891344532990994108485313",
"173307191214505129898373649875476725787",
"101100681456993514427147901917584293083",
"329233171682136690454130720936347826648"
]
},
"id": "CVE-2024-56655-998ce6a6",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5146c27b2780aac59876a887a5f4e793b8949862",
"target": {
"file": "net/netfilter/nf_tables_api.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 292.0,
"function_hash": "124195095067184910825024787766240872263"
},
"id": "CVE-2024-56655-9deba63d",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nft_release_basechain_rcu"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 143.0,
"function_hash": "284304899288686065268980947528217775515"
},
"id": "CVE-2024-56655-a1f88d52",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_rule_release"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 143.0,
"function_hash": "284304899288686065268980947528217775515"
},
"id": "CVE-2024-56655-a4b36fd9",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0f013bebf94fe7ae75e5a53be2f2bd1cc1841e3",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_rule_release"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"123656555542263724085958814027993865141",
"273363564856853663435733929062221314841",
"122578833396545997839555350669039804450",
"269963360065794686296702709131467937222",
"179903893833450110735920806261827194025",
"278939166972522970546382326302296458905",
"17096592994196017974281977204073931400",
"59990617408768272502547209292952109316",
"239120332530624416012246903427945667627",
"55901828066873821376347685396052800879",
"4870713759330099550194795482081273599",
"336386893149348823663135939983859293749",
"169093262534579363666978042604587143426",
"294188687614261705875978785642108470734"
]
},
"id": "CVE-2024-56655-af3bf748",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "include/net/netfilter/nf_tables.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 495.0,
"function_hash": "250472909207345825984220206147070222612"
},
"id": "CVE-2024-56655-b986e02f",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "__nft_release_basechain"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 143.0,
"function_hash": "284304899288686065268980947528217775515"
},
"id": "CVE-2024-56655-d5a7e385",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_rule_release"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 796.0,
"function_hash": "58062093416808777897363177089339855071"
},
"id": "CVE-2024-56655-ddd463bf",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2991dc357a28b61c13ed1f7b59e9251e2b4562fb",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_deactivate_set"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52406798831249034605657372461205896965",
"321108354501734323475322641513867528096",
"218572727371677532168831596406036492977",
"329732343816231437194487918387315704435",
"314899792593679965403968063375833842941",
"313896647953449685336850552776041582524",
"27704813292231614195800743398505851567",
"223379006704289451406926268871222683766",
"321520053814714824168807307146187416995",
"117675707067085739469112169527070604754",
"332440699730513737737695324707135130294",
"120494707681717025646948723997776007226",
"94795260559170949538434461726082883871",
"78335275065957410634056665558099574834",
"300553542072646544790680618229113134188",
"101401628667189320353015141879466327551",
"182607065142963335258256663945557257563",
"162196525398974483869148880842360852210",
"141417512434365936128919629679731654138",
"175568739473185788754912992593484359941",
"134078567056960269972350917448934999023",
"189799065523441952458837486369763376019",
"318535004141185768118760270071327589446",
"52364435625609516066046454847205123108",
"155362949980990934420131990365083830985",
"319761102844646045482496609287095602986",
"65949466065408728842310486894100929091",
"262741019422917581553372103753746614023",
"14185005923845372111472456293710192755",
"285431062864621941694139087002696920239",
"211698840922933891344532990994108485313",
"173307191214505129898373649875476725787",
"101100681456993514427147901917584293083",
"329233171682136690454130720936347826648"
]
},
"id": "CVE-2024-56655-e1bfc319",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@27f0574253f6c24c8ee4e3f0a685b75ed3a256ed",
"target": {
"file": "net/netfilter/nf_tables_api.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 796.0,
"function_hash": "58062093416808777897363177089339855071"
},
"id": "CVE-2024-56655-fd9a854f",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "net/netfilter/nf_tables_api.c",
"function": "nf_tables_deactivate_set"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52406798831249034605657372461205896965",
"321108354501734323475322641513867528096",
"218572727371677532168831596406036492977",
"329732343816231437194487918387315704435",
"314899792593679965403968063375833842941",
"313896647953449685336850552776041582524",
"27704813292231614195800743398505851567",
"223379006704289451406926268871222683766",
"321520053814714824168807307146187416995",
"117675707067085739469112169527070604754",
"332440699730513737737695324707135130294",
"120494707681717025646948723997776007226",
"94795260559170949538434461726082883871",
"78335275065957410634056665558099574834",
"300553542072646544790680618229113134188",
"101401628667189320353015141879466327551",
"182607065142963335258256663945557257563",
"162196525398974483869148880842360852210",
"141417512434365936128919629679731654138",
"175568739473185788754912992593484359941",
"134078567056960269972350917448934999023",
"189799065523441952458837486369763376019",
"318535004141185768118760270071327589446",
"52364435625609516066046454847205123108",
"155362949980990934420131990365083830985",
"319761102844646045482496609287095602986",
"65949466065408728842310486894100929091",
"262741019422917581553372103753746614023",
"14185005923845372111472456293710192755",
"285431062864621941694139087002696920239",
"211698840922933891344532990994108485313",
"173307191214505129898373649875476725787",
"101100681456993514427147901917584293083",
"329233171682136690454130720936347826648"
]
},
"id": "CVE-2024-56655-ff5f1731",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cf0bd232b565d9852cb25fd094f77254773e048",
"target": {
"file": "net/netfilter/nf_tables_api.c"
}
}
]