cve-2021-46954
Vulnerability from cvelistv5
Published
2024-02-27 18:46
Modified
2024-11-04 11:56
Severity ?
Summary
net/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-46954",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-02-27T19:36:31.837631Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-07-05T17:21:04.639Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:17:42.983Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/018bb8da5b5888e19585f9b802f036afe643fcef"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/8e6dfb7beeb6489ac1365b8a71052e737f5da76e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/31fe34a0118e0acc958c802e830ad5d37ef6b1d3"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "net/sched/sch_frag.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "018bb8da5b58",
              "status": "affected",
              "version": "c129412f74e9",
              "versionType": "git"
            },
            {
              "lessThan": "8e6dfb7beeb6",
              "status": "affected",
              "version": "c129412f74e9",
              "versionType": "git"
            },
            {
              "lessThan": "31fe34a0118e",
              "status": "affected",
              "version": "c129412f74e9",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "net/sched/sch_frag.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.11"
            },
            {
              "lessThan": "5.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.11.*",
              "status": "unaffected",
              "version": "5.11.20",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.12.*",
              "status": "unaffected",
              "version": "5.12.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets\n\nwhen \u0027act_mirred\u0027 tries to fragment IPv4 packets that had been previously\nre-assembled using \u0027act_ct\u0027, splats like the following can be observed on\nkernels built with KASAN:\n\n BUG: KASAN: stack-out-of-bounds in ip_do_fragment+0x1b03/0x1f60\n Read of size 1 at addr ffff888147009574 by task ping/947\n\n CPU: 0 PID: 947 Comm: ping Not tainted 5.12.0-rc6+ #418\n Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014\n Call Trace:\n  \u003cIRQ\u003e\n  dump_stack+0x92/0xc1\n  print_address_description.constprop.7+0x1a/0x150\n  kasan_report.cold.13+0x7f/0x111\n  ip_do_fragment+0x1b03/0x1f60\n  sch_fragment+0x4bf/0xe40\n  tcf_mirred_act+0xc3d/0x11a0 [act_mirred]\n  tcf_action_exec+0x104/0x3e0\n  fl_classify+0x49a/0x5e0 [cls_flower]\n  tcf_classify_ingress+0x18a/0x820\n  __netif_receive_skb_core+0xae7/0x3340\n  __netif_receive_skb_one_core+0xb6/0x1b0\n  process_backlog+0x1ef/0x6c0\n  __napi_poll+0xaa/0x500\n  net_rx_action+0x702/0xac0\n  __do_softirq+0x1e4/0x97f\n  do_softirq+0x71/0x90\n  \u003c/IRQ\u003e\n  __local_bh_enable_ip+0xdb/0xf0\n  ip_finish_output2+0x760/0x2120\n  ip_do_fragment+0x15a5/0x1f60\n  __ip_finish_output+0x4c2/0xea0\n  ip_output+0x1ca/0x4d0\n  ip_send_skb+0x37/0xa0\n  raw_sendmsg+0x1c4b/0x2d00\n  sock_sendmsg+0xdb/0x110\n  __sys_sendto+0x1d7/0x2b0\n  __x64_sys_sendto+0xdd/0x1b0\n  do_syscall_64+0x33/0x40\n  entry_SYSCALL_64_after_hwframe+0x44/0xae\n RIP: 0033:0x7f82e13853eb\n Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 48 8d 05 75 42 2c 00 41 89 ca 8b 00 85 c0 75 14 b8 2c 00 00 00 0f 05 \u003c48\u003e 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 41 57 4d 89 c7 41 56 41 89\n RSP: 002b:00007ffe01fad888 EFLAGS: 00000246 ORIG_RAX: 000000000000002c\n RAX: ffffffffffffffda RBX: 00005571aac13700 RCX: 00007f82e13853eb\n RDX: 0000000000002330 RSI: 00005571aac13700 RDI: 0000000000000003\n RBP: 0000000000002330 R08: 00005571aac10500 R09: 0000000000000010\n R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe01faefb0\n R13: 00007ffe01fad890 R14: 00007ffe01fad980 R15: 00005571aac0f0a0\n\n The buggy address belongs to the page:\n page:000000001dff2e03 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x147009\n flags: 0x17ffffc0001000(reserved)\n raw: 0017ffffc0001000 ffffea00051c0248 ffffea00051c0248 0000000000000000\n raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000\n page dumped because: kasan: bad access detected\n\n Memory state around the buggy address:\n  ffff888147009400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  ffff888147009480: f1 f1 f1 f1 04 f2 f2 f2 f2 f2 f2 f2 00 00 00 00\n \u003effff888147009500: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 f2 f2\n                                                              ^\n  ffff888147009580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  ffff888147009600: 00 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2\n\nfor IPv4 packets, sch_fragment() uses a temporary struct dst_entry. Then,\nin the following call graph:\n\n  ip_do_fragment()\n    ip_skb_dst_mtu()\n      ip_dst_mtu_maybe_forward()\n        ip_mtu_locked()\n\nthe pointer to struct dst_entry is used as pointer to struct rtable: this\nturns the access to struct members like rt_mtu_locked into an OOB read in\nthe stack. Fix this changing the temporary variable used for IPv4 packets\nin sch_fragment(), similarly to what is done for IPv6 few lines below."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-04T11:56:34.552Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/018bb8da5b5888e19585f9b802f036afe643fcef"
        },
        {
          "url": "https://git.kernel.org/stable/c/8e6dfb7beeb6489ac1365b8a71052e737f5da76e"
        },
        {
          "url": "https://git.kernel.org/stable/c/31fe34a0118e0acc958c802e830ad5d37ef6b1d3"
        }
      ],
      "title": "net/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-46954",
    "datePublished": "2024-02-27T18:46:56.804Z",
    "dateReserved": "2024-02-27T18:42:55.937Z",
    "dateUpdated": "2024-11-04T11:56:34.552Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2021-46954\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-02-27T19:04:06.617\",\"lastModified\":\"2024-04-10T20:15:05.997\",\"vulnStatus\":\"Analyzed\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets\\n\\nwhen \u0027act_mirred\u0027 tries to fragment IPv4 packets that had been previously\\nre-assembled using \u0027act_ct\u0027, splats like the following can be observed on\\nkernels built with KASAN:\\n\\n BUG: KASAN: stack-out-of-bounds in ip_do_fragment+0x1b03/0x1f60\\n Read of size 1 at addr ffff888147009574 by task ping/947\\n\\n CPU: 0 PID: 947 Comm: ping Not tainted 5.12.0-rc6+ #418\\n Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014\\n Call Trace:\\n  \u003cIRQ\u003e\\n  dump_stack+0x92/0xc1\\n  print_address_description.constprop.7+0x1a/0x150\\n  kasan_report.cold.13+0x7f/0x111\\n  ip_do_fragment+0x1b03/0x1f60\\n  sch_fragment+0x4bf/0xe40\\n  tcf_mirred_act+0xc3d/0x11a0 [act_mirred]\\n  tcf_action_exec+0x104/0x3e0\\n  fl_classify+0x49a/0x5e0 [cls_flower]\\n  tcf_classify_ingress+0x18a/0x820\\n  __netif_receive_skb_core+0xae7/0x3340\\n  __netif_receive_skb_one_core+0xb6/0x1b0\\n  process_backlog+0x1ef/0x6c0\\n  __napi_poll+0xaa/0x500\\n  net_rx_action+0x702/0xac0\\n  __do_softirq+0x1e4/0x97f\\n  do_softirq+0x71/0x90\\n  \u003c/IRQ\u003e\\n  __local_bh_enable_ip+0xdb/0xf0\\n  ip_finish_output2+0x760/0x2120\\n  ip_do_fragment+0x15a5/0x1f60\\n  __ip_finish_output+0x4c2/0xea0\\n  ip_output+0x1ca/0x4d0\\n  ip_send_skb+0x37/0xa0\\n  raw_sendmsg+0x1c4b/0x2d00\\n  sock_sendmsg+0xdb/0x110\\n  __sys_sendto+0x1d7/0x2b0\\n  __x64_sys_sendto+0xdd/0x1b0\\n  do_syscall_64+0x33/0x40\\n  entry_SYSCALL_64_after_hwframe+0x44/0xae\\n RIP: 0033:0x7f82e13853eb\\n Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 48 8d 05 75 42 2c 00 41 89 ca 8b 00 85 c0 75 14 b8 2c 00 00 00 0f 05 \u003c48\u003e 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 41 57 4d 89 c7 41 56 41 89\\n RSP: 002b:00007ffe01fad888 EFLAGS: 00000246 ORIG_RAX: 000000000000002c\\n RAX: ffffffffffffffda RBX: 00005571aac13700 RCX: 00007f82e13853eb\\n RDX: 0000000000002330 RSI: 00005571aac13700 RDI: 0000000000000003\\n RBP: 0000000000002330 R08: 00005571aac10500 R09: 0000000000000010\\n R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe01faefb0\\n R13: 00007ffe01fad890 R14: 00007ffe01fad980 R15: 00005571aac0f0a0\\n\\n The buggy address belongs to the page:\\n page:000000001dff2e03 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x147009\\n flags: 0x17ffffc0001000(reserved)\\n raw: 0017ffffc0001000 ffffea00051c0248 ffffea00051c0248 0000000000000000\\n raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000\\n page dumped because: kasan: bad access detected\\n\\n Memory state around the buggy address:\\n  ffff888147009400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\\n  ffff888147009480: f1 f1 f1 f1 04 f2 f2 f2 f2 f2 f2 f2 00 00 00 00\\n \u003effff888147009500: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 f2 f2\\n                                                              ^\\n  ffff888147009580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\\n  ffff888147009600: 00 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2\\n\\nfor IPv4 packets, sch_fragment() uses a temporary struct dst_entry. Then,\\nin the following call graph:\\n\\n  ip_do_fragment()\\n    ip_skb_dst_mtu()\\n      ip_dst_mtu_maybe_forward()\\n        ip_mtu_locked()\\n\\nthe pointer to struct dst_entry is used as pointer to struct rtable: this\\nturns the access to struct members like rt_mtu_locked into an OOB read in\\nthe stack. Fix this changing the temporary variable used for IPv4 packets\\nin sch_fragment(), similarly to what is done for IPv6 few lines below.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net/sched: sch_frag: corrige la lectura OOB de la pila al fragmentar paquetes IPv4 cuando \u0027act_mirred\u0027 intenta fragmentar paquetes IPv4 que se hab\u00edan reensamblado previamente usando \u0027act_ct\u0027, s\u00edmbolos como el Se puede observar lo siguiente en los n\u00facleos creados con KASAN: ERROR: KASAN: pila fuera de los l\u00edmites en ip_do_fragment+0x1b03/0x1f60 Lectura de tama\u00f1o 1 en la direcci\u00f3n ffff888147009574 mediante tarea ping/947 CPU: 0 PID: 947 Comm: ping no contaminado 5.12.0-rc6+ #418 Nombre de hardware: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 01/04/2014 Seguimiento de llamadas:  dump_stack+0x92/0xc1 print_address_description.constprop. 7+0x1a/0x150 kasan_report.cold.13+0x7f/0x111 ip_do_fragment+0x1b03/0x1f60 sch_fragment+0x4bf/0xe40 tcf_mirred_act+0xc3d/0x11a0 [act_mirred] tcf_action_exec+0x104/0x3e0 fl_classify+0 x49a/0x5e0 [cls_flower] tcf_classify_ingress+0x18a/0x820 __netif_receive_skb_core+0xae7/0x3340 __netif_receive_skb_one_core+0xb6/0x1b0 Process_backlog+0x1ef/0x6c0 __napi_poll+0xaa/0x500 net_rx_action+0x702/0xac0 __do_softirq+0x1e4/0x97f do_softirq +0x71/0x90  __local_bh_enable_ip+0xdb/0xf0 ip_finish_output2+0x760/0x2120 ip_do_fragment +0x15a5/0x1f60 __ip_finish_output+0x4c2/0xea0 ip_output+0x1ca/0x4d0 ip_send_skb+0x37/0xa0 raw_sendmsg+0x1c4b/0x2d00 sock_sendmsg+0xdb/0x110 __sys_sendto+0x1d7/0x 2b0 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0x33/0x40 Entry_SYSCALL_64_after_hwframe+0x44/0xae RIP : 0033:0x7f82e13853eb C\u00f3digo: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 48 8d 05 75 42 2c 00 41 89 ca 8b 00 85 c0 75 14 b8 2c 00 00 00 0f 05 \u0026lt;48 \u0026gt; 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 41 57 4d 89 c7 41 56 41 89 RSP: 002b:00007ffe01fad888 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffff ffffffffffda RBX: 00005571aac13700 RCX: 00007f82e13853eb RDX: 0000000000002330 RSI: 00005571aac13700 RDI: 0000000000000003 RBP: 0000000000002330 R08: 00005571aac10500 R09: 0000000000000010 R10: 00000000000000000 R11: 0000000000000246 R12: 00007ffe01faefb0 R13: 00007ffe01fad890 R14: 00007ffe01fad980 R15: 00005571aac0f0a0 La direcci\u00f3n del error pertenece a la p\u00e1gina: p\u00e1gina:000000001dff2e03 refcount:1 mapcount:0 mapeo:0000000000000000 \u00edndice: 0x0 pfn:0x147009 banderas: 0x17ffffc0001000(reservado) raw: 0017ffffc0001000 ffffea00051c0248 ffffea00051c0248 0000000000000000 raw: 0000000000000000 0000 000000000000 00000001ffffffff 00000000000000000 p\u00e1gina volcada porque: kasan: se detect\u00f3 mal acceso Estado de la memoria alrededor de la direcci\u00f3n con errores: ffff888147009400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888147009480: f1 f1 f1 f1 04 f2 f2 f2 f2 f2 f2 f2 00 00 00 00 \u0026gt;ffff888147009500: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f 2 f2 f2^ffff888147009580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888147009600: 00 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 para paquetes IPv4, sch_fragment() utiliza una estructura temporal dst_entry. Luego, en el siguiente gr\u00e1fico de llamadas: ip_do_fragment() ip_skb_dst_mtu() ip_dst_mtu_maybe_forward() ip_mtu_locked() el puntero a struct dst_entry se usa como puntero a struct rtable: esto convierte el acceso a miembros de estructura como rt_mtu_locked en una lectura OOB en la pila. Solucione este problema cambiando la variable temporal utilizada para los paquetes IPv4 en sch_fragment(), de manera similar a lo que se hace para IPv6 unas l\u00edneas m\u00e1s abajo.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\",\"baseScore\":7.1,\"baseSeverity\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.2}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-125\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.11.0\",\"versionEndExcluding\":\"5.11.20\",\"matchCriteriaId\":\"EFB425F0-C28C-4B44-8B4C-AD512AA832DE\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.12.0\",\"versionEndExcluding\":\"5.12.3\",\"matchCriteriaId\":\"C3814FA3-8141-4313-A852-8C4212BE12AD\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/018bb8da5b5888e19585f9b802f036afe643fcef\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/31fe34a0118e0acc958c802e830ad5d37ef6b1d3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/8e6dfb7beeb6489ac1365b8a71052e737f5da76e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.