In the Linux kernel, the following vulnerability has been resolved:
netlink: fix false positive warning in extack during dumps
Commit under fixes extended extack reporting to dumps. It works under normal conditions, because extack errors are usually reported during ->start() or the first ->dump(), it's quite rare that the dump starts okay but fails later. If the dump does fail later, however, the input skb will already have the initiating message pulled, so checking if bad attr falls within skb->data will fail.
Switch the check to using nlh, which is always valid.
syzbot found a way to hit that scenario by filling up the receive queue. In this case we initiate a dump but don't call ->dump() until there is read space for an skb.
WARNING: CPU: 1 PID: 5845 at net/netlink/afnetlink.c:2210 netlinkacktlvfill+0x1a8/0x560 net/netlink/afnetlink.c:2209 RIP: 0010:netlinkacktlvfill+0x1a8/0x560 net/netlink/afnetlink.c:2209 Call Trace: <TASK> netlinkdumpdone+0x513/0x970 net/netlink/afnetlink.c:2250 netlinkdump+0x91f/0xe10 net/netlink/afnetlink.c:2351 netlinkrecvmsg+0x6bb/0x11d0 net/netlink/afnetlink.c:1983 sockrecvmsgnosec net/socket.c:1051 [inline] sockrecvmsg+0x22f/0x280 net/socket.c:1073 _sysrecvfrom+0x246/0x3d0 net/socket.c:2267 _dosysrecvfrom net/socket.c:2285 [inline] _sesysrecvfrom net/socket.c:2281 [inline] _x64sysrecvfrom+0xde/0x100 net/socket.c:2281 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xf3/0x230 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f RIP: 0033:0x7ff37dd17a79
[
{
"digest": {
"function_hash": "200140899895044918999973109407978908545",
"length": 1221.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-246bed08",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6406d0ce0414b807af5d2a4b781c3f3ee52b8a4d",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "200140899895044918999973109407978908545",
"length": 1221.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-274015d9",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf39fa849ab8ed52abb6715922e6102d3df9f97",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "250393858395546269284662149853271841563",
"length": 691.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-32b81c35",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_dump_done"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6406d0ce0414b807af5d2a4b781c3f3ee52b8a4d",
"signature_type": "Function"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"218140787169480090005092870380027017791",
"111604255769144772925760335331165850481",
"79221816838429126298861458923042872344",
"151583455199409075713613717808624405868",
"326156425027951815005668234530126846866",
"188090002515197470195974231179335222635",
"223187330035310335538085838955071988760",
"63142240447801850743193441838378010387",
"217288162877396187940630109860944552286",
"285301607625285623443821251406902815035",
"15914096295438108921459931763660365075",
"310917867992090571944987999701672026082",
"181767517523744504916669610233433170265",
"76147295807033364971556409605397221370",
"317515103033240656441396688939543820925",
"280395259378009532035130355638690221829",
"209317914942568048943034732389125571448",
"25720766751635546132507991186594017223",
"299938197797336117309200102023548232729",
"228512552931691443966185904465101961610",
"250907473228273158461758103921073079954",
"97317527346898086576887486069460930503",
"135702497087546875708951171076283216672",
"102742335722946977526973882574404076957",
"131277521952816396080394401862904279188",
"86036547290032491730562526997866971796"
]
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-363f394b",
"target": {
"file": "net/netlink/af_netlink.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf39fa849ab8ed52abb6715922e6102d3df9f97",
"signature_type": "Line"
},
{
"digest": {
"function_hash": "146267474566227668736669610417552593303",
"length": 1090.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-3a10a580",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack_tlv_fill"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28af028a71371df5fcbf807fd4444bba8d0c33cc",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "250393858395546269284662149853271841563",
"length": 691.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-b5ae4464",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_dump_done"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28af028a71371df5fcbf807fd4444bba8d0c33cc",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "200140899895044918999973109407978908545",
"length": 1221.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-c491d5d8",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28af028a71371df5fcbf807fd4444bba8d0c33cc",
"signature_type": "Function"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"218140787169480090005092870380027017791",
"111604255769144772925760335331165850481",
"79221816838429126298861458923042872344",
"151583455199409075713613717808624405868",
"326156425027951815005668234530126846866",
"188090002515197470195974231179335222635",
"223187330035310335538085838955071988760",
"63142240447801850743193441838378010387",
"217288162877396187940630109860944552286",
"285301607625285623443821251406902815035",
"15914096295438108921459931763660365075",
"310917867992090571944987999701672026082",
"181767517523744504916669610233433170265",
"76147295807033364971556409605397221370",
"317515103033240656441396688939543820925",
"280395259378009532035130355638690221829",
"209317914942568048943034732389125571448",
"25720766751635546132507991186594017223",
"299938197797336117309200102023548232729",
"228512552931691443966185904465101961610",
"250907473228273158461758103921073079954",
"97317527346898086576887486069460930503",
"135702497087546875708951171076283216672",
"102742335722946977526973882574404076957",
"131277521952816396080394401862904279188",
"86036547290032491730562526997866971796"
]
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-d9ea80d3",
"target": {
"file": "net/netlink/af_netlink.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6406d0ce0414b807af5d2a4b781c3f3ee52b8a4d",
"signature_type": "Line"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"218140787169480090005092870380027017791",
"111604255769144772925760335331165850481",
"79221816838429126298861458923042872344",
"151583455199409075713613717808624405868",
"326156425027951815005668234530126846866",
"188090002515197470195974231179335222635",
"223187330035310335538085838955071988760",
"63142240447801850743193441838378010387",
"217288162877396187940630109860944552286",
"285301607625285623443821251406902815035",
"15914096295438108921459931763660365075",
"310917867992090571944987999701672026082",
"181767517523744504916669610233433170265",
"76147295807033364971556409605397221370",
"317515103033240656441396688939543820925",
"280395259378009532035130355638690221829",
"209317914942568048943034732389125571448",
"25720766751635546132507991186594017223",
"299938197797336117309200102023548232729",
"228512552931691443966185904465101961610",
"250907473228273158461758103921073079954",
"97317527346898086576887486069460930503",
"135702497087546875708951171076283216672",
"102742335722946977526973882574404076957",
"131277521952816396080394401862904279188",
"86036547290032491730562526997866971796"
]
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-dd5fbc49",
"target": {
"file": "net/netlink/af_netlink.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28af028a71371df5fcbf807fd4444bba8d0c33cc",
"signature_type": "Line"
},
{
"digest": {
"function_hash": "146267474566227668736669610417552593303",
"length": 1090.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-eb63a4cc",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack_tlv_fill"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf39fa849ab8ed52abb6715922e6102d3df9f97",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "250393858395546269284662149853271841563",
"length": 691.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-f9278de5",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_dump_done"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf39fa849ab8ed52abb6715922e6102d3df9f97",
"signature_type": "Function"
},
{
"digest": {
"function_hash": "146267474566227668736669610417552593303",
"length": 1090.0
},
"deprecated": false,
"signature_version": "v1",
"id": "CVE-2024-53212-fac2a0b4",
"target": {
"file": "net/netlink/af_netlink.c",
"function": "netlink_ack_tlv_fill"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6406d0ce0414b807af5d2a4b781c3f3ee52b8a4d",
"signature_type": "Function"
}
]