In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: fix nftcountersenabled underflow at nftables_addchain()
syzbot is reporting underflow of nftcountersenabled counter at nftablesaddchain() [1], for commit 43eb8949cfdffa76 ("netfilter: nftables: do not leave chain stats enabled on error") missed that nftableschaindestroy() after nftbasechaininit() in the error path of nftablesaddchain() decrements the counter because nftbasechaininit() makes nftisbasechain() return true by setting NFTCHAIN_BASE flag.
Increment the counter immediately after returning from nftbasechaininit().
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8bcad2a931313aeba076b76922d5813ef97d0a91",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-271c4068",
"target": {
"function": "nf_tables_addchain",
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"length": 2840.0,
"function_hash": "184528273155423572132800824306780848573"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@91aa52652f4b37089aff3cb53e83049d826fef6d",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-2ab84b9b",
"target": {
"function": "nf_tables_addchain",
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"length": 2753.0,
"function_hash": "177335988516786599944357633026727254279"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@710e3f526bd23a0d33435dedc52c3144de284378",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-52c7a9e9",
"target": {
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"170454929693053930988022809987417511407",
"54966068085112535187809573335302404621",
"165364300495492407894891100050121900274",
"207250344611914079312989550002753048425",
"187026060301485800238168545076652821246",
"147555595102991314706299668285811688738",
"168401148892892341821945999171038403035",
"136257061738148774397836703243018610726",
"121443924845365930011198963642849191692",
"83364803426216058933372817634371891218",
"89721032868964719101186283361763391026",
"230112867165311960005194606808612363124",
"184882004586650889790993871873843533464",
"13173156564624860164736990278663853204",
"228979086545045643637946473191201586804",
"194224460158832008315875135074101172927",
"160949346094702166678313039344494712156"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8bcad2a931313aeba076b76922d5813ef97d0a91",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-9449f0ef",
"target": {
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"263508705780392362285064441453606618675",
"54966068085112535187809573335302404621",
"165364300495492407894891100050121900274",
"207250344611914079312989550002753048425",
"187026060301485800238168545076652821246",
"147555595102991314706299668285811688738",
"168401148892892341821945999171038403035",
"136257061738148774397836703243018610726",
"121443924845365930011198963642849191692",
"83364803426216058933372817634371891218",
"89721032868964719101186283361763391026",
"230112867165311960005194606808612363124",
"184882004586650889790993871873843533464",
"13173156564624860164736990278663853204",
"228979086545045643637946473191201586804",
"194224460158832008315875135074101172927",
"160949346094702166678313039344494712156"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@91aa52652f4b37089aff3cb53e83049d826fef6d",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-9b5c59fd",
"target": {
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"263508705780392362285064441453606618675",
"54966068085112535187809573335302404621",
"165364300495492407894891100050121900274",
"207250344611914079312989550002753048425",
"187026060301485800238168545076652821246",
"147555595102991314706299668285811688738",
"168401148892892341821945999171038403035",
"136257061738148774397836703243018610726",
"121443924845365930011198963642849191692",
"83364803426216058933372817634371891218",
"89721032868964719101186283361763391026",
"230112867165311960005194606808612363124",
"184882004586650889790993871873843533464",
"13173156564624860164736990278663853204",
"228979086545045643637946473191201586804",
"194224460158832008315875135074101172927",
"160949346094702166678313039344494712156"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@710e3f526bd23a0d33435dedc52c3144de284378",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-48643-ac4f69db",
"target": {
"function": "nf_tables_addchain",
"file": "net/netfilter/nf_tables_api.c"
},
"digest": {
"length": 2729.0,
"function_hash": "282953513413631445234920873004355164299"
},
"signature_type": "Function"
}
]