cve-2024-26669
Vulnerability from cvelistv5
Published
2024-04-02 06:43
Modified
2024-08-02 00:14
Severity
Summary
net/sched: flower: Fix chain template offload
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-26669",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-04-02T18:36:26.875588Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:48:22.796Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T00:14:12.714Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/9ed46144cff3598a5cf79955630e795ff9af5b97"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/c04709b2cc99ae31c346f79f0211752d7b74df01"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/32f2a0afa95fae0d1ceec2ff06e0e816939964b8"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/net/sch_generic.h",
            "net/sched/cls_api.c",
            "net/sched/cls_flower.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "9ed46144cff3",
              "status": "affected",
              "version": "bbf73830cd48",
              "versionType": "git"
            },
            {
              "lessThan": "c04709b2cc99",
              "status": "affected",
              "version": "bbf73830cd48",
              "versionType": "git"
            },
            {
              "lessThan": "32f2a0afa95f",
              "status": "affected",
              "version": "bbf73830cd48",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/net/sch_generic.h",
            "net/sched/cls_api.c",
            "net/sched/cls_flower.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.1"
            },
            {
              "lessThan": "5.1",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.15",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.3",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.8",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sched: flower: Fix chain template offload\n\nWhen a qdisc is deleted from a net device the stack instructs the\nunderlying driver to remove its flow offload callback from the\nassociated filter block using the \u0027FLOW_BLOCK_UNBIND\u0027 command. The stack\nthen continues to replay the removal of the filters in the block for\nthis driver by iterating over the chains in the block and invoking the\n\u0027reoffload\u0027 operation of the classifier being used. In turn, the\nclassifier in its \u0027reoffload\u0027 operation prepares and emits a\n\u0027FLOW_CLS_DESTROY\u0027 command for each filter.\n\nHowever, the stack does not do the same for chain templates and the\nunderlying driver never receives a \u0027FLOW_CLS_TMPLT_DESTROY\u0027 command when\na qdisc is deleted. This results in a memory leak [1] which can be\nreproduced using [2].\n\nFix by introducing a \u0027tmplt_reoffload\u0027 operation and have the stack\ninvoke it with the appropriate arguments as part of the replay.\nImplement the operation in the sole classifier that supports chain\ntemplates (flower) by emitting the \u0027FLOW_CLS_TMPLT_{CREATE,DESTROY}\u0027\ncommand based on whether a flow offload callback is being bound to a\nfilter block or being unbound from one.\n\nAs far as I can tell, the issue happens since cited commit which\nreordered tcf_block_offload_unbind() before tcf_block_flush_all_chains()\nin __tcf_block_put(). The order cannot be reversed as the filter block\nis expected to be freed after flushing all the chains.\n\n[1]\nunreferenced object 0xffff888107e28800 (size 2048):\n  comm \"tc\", pid 1079, jiffies 4294958525 (age 3074.287s)\n  hex dump (first 32 bytes):\n    b1 a6 7c 11 81 88 ff ff e0 5b b3 10 81 88 ff ff  ..|......[......\n    01 00 00 00 00 00 00 00 e0 aa b0 84 ff ff ff ff  ................\n  backtrace:\n    [\u003cffffffff81c06a68\u003e] __kmem_cache_alloc_node+0x1e8/0x320\n    [\u003cffffffff81ab374e\u003e] __kmalloc+0x4e/0x90\n    [\u003cffffffff832aec6d\u003e] mlxsw_sp_acl_ruleset_get+0x34d/0x7a0\n    [\u003cffffffff832bc195\u003e] mlxsw_sp_flower_tmplt_create+0x145/0x180\n    [\u003cffffffff832b2e1a\u003e] mlxsw_sp_flow_block_cb+0x1ea/0x280\n    [\u003cffffffff83a10613\u003e] tc_setup_cb_call+0x183/0x340\n    [\u003cffffffff83a9f85a\u003e] fl_tmplt_create+0x3da/0x4c0\n    [\u003cffffffff83a22435\u003e] tc_ctl_chain+0xa15/0x1170\n    [\u003cffffffff838a863c\u003e] rtnetlink_rcv_msg+0x3cc/0xed0\n    [\u003cffffffff83ac87f0\u003e] netlink_rcv_skb+0x170/0x440\n    [\u003cffffffff83ac6270\u003e] netlink_unicast+0x540/0x820\n    [\u003cffffffff83ac6e28\u003e] netlink_sendmsg+0x8d8/0xda0\n    [\u003cffffffff83793def\u003e] ____sys_sendmsg+0x30f/0xa80\n    [\u003cffffffff8379d29a\u003e] ___sys_sendmsg+0x13a/0x1e0\n    [\u003cffffffff8379d50c\u003e] __sys_sendmsg+0x11c/0x1f0\n    [\u003cffffffff843b9ce0\u003e] do_syscall_64+0x40/0xe0\nunreferenced object 0xffff88816d2c0400 (size 1024):\n  comm \"tc\", pid 1079, jiffies 4294958525 (age 3074.287s)\n  hex dump (first 32 bytes):\n    40 00 00 00 00 00 00 00 57 f6 38 be 00 00 00 00  @.......W.8.....\n    10 04 2c 6d 81 88 ff ff 10 04 2c 6d 81 88 ff ff  ..,m......,m....\n  backtrace:\n    [\u003cffffffff81c06a68\u003e] __kmem_cache_alloc_node+0x1e8/0x320\n    [\u003cffffffff81ab36c1\u003e] __kmalloc_node+0x51/0x90\n    [\u003cffffffff81a8ed96\u003e] kvmalloc_node+0xa6/0x1f0\n    [\u003cffffffff82827d03\u003e] bucket_table_alloc.isra.0+0x83/0x460\n    [\u003cffffffff82828d2b\u003e] rhashtable_init+0x43b/0x7c0\n    [\u003cffffffff832aed48\u003e] mlxsw_sp_acl_ruleset_get+0x428/0x7a0\n    [\u003cffffffff832bc195\u003e] mlxsw_sp_flower_tmplt_create+0x145/0x180\n    [\u003cffffffff832b2e1a\u003e] mlxsw_sp_flow_block_cb+0x1ea/0x280\n    [\u003cffffffff83a10613\u003e] tc_setup_cb_call+0x183/0x340\n    [\u003cffffffff83a9f85a\u003e] fl_tmplt_create+0x3da/0x4c0\n    [\u003cffffffff83a22435\u003e] tc_ctl_chain+0xa15/0x1170\n    [\u003cffffffff838a863c\u003e] rtnetlink_rcv_msg+0x3cc/0xed0\n    [\u003cffffffff83ac87f0\u003e] netlink_rcv_skb+0x170/0x440\n    [\u003cffffffff83ac6270\u003e] netlink_unicast+0x540/0x820\n    [\u003cffffffff83ac6e28\u003e] netlink_sendmsg+0x8d8/0xda0\n    [\u003cffffffff83793def\u003e] ____sys_sendmsg+0x30f/0xa80\n\n[2]\n # tc qdisc add dev swp1 clsact\n # tc chain add dev swp1 ingress proto ip chain 1 flower dst_ip 0.0.0.0/32\n # tc qdisc del dev\n---truncated---"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-29T05:20:31.644Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/9ed46144cff3598a5cf79955630e795ff9af5b97"
        },
        {
          "url": "https://git.kernel.org/stable/c/c04709b2cc99ae31c346f79f0211752d7b74df01"
        },
        {
          "url": "https://git.kernel.org/stable/c/32f2a0afa95fae0d1ceec2ff06e0e816939964b8"
        }
      ],
      "title": "net/sched: flower: Fix chain template offload",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-26669",
    "datePublished": "2024-04-02T06:43:30.378Z",
    "dateReserved": "2024-02-19T14:20:24.150Z",
    "dateUpdated": "2024-08-02T00:14:12.714Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-26669\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-04-02T07:15:43.697\",\"lastModified\":\"2024-04-02T12:50:42.233\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet/sched: flower: Fix chain template offload\\n\\nWhen a qdisc is deleted from a net device the stack instructs the\\nunderlying driver to remove its flow offload callback from the\\nassociated filter block using the \u0027FLOW_BLOCK_UNBIND\u0027 command. The stack\\nthen continues to replay the removal of the filters in the block for\\nthis driver by iterating over the chains in the block and invoking the\\n\u0027reoffload\u0027 operation of the classifier being used. In turn, the\\nclassifier in its \u0027reoffload\u0027 operation prepares and emits a\\n\u0027FLOW_CLS_DESTROY\u0027 command for each filter.\\n\\nHowever, the stack does not do the same for chain templates and the\\nunderlying driver never receives a \u0027FLOW_CLS_TMPLT_DESTROY\u0027 command when\\na qdisc is deleted. This results in a memory leak [1] which can be\\nreproduced using [2].\\n\\nFix by introducing a \u0027tmplt_reoffload\u0027 operation and have the stack\\ninvoke it with the appropriate arguments as part of the replay.\\nImplement the operation in the sole classifier that supports chain\\ntemplates (flower) by emitting the \u0027FLOW_CLS_TMPLT_{CREATE,DESTROY}\u0027\\ncommand based on whether a flow offload callback is being bound to a\\nfilter block or being unbound from one.\\n\\nAs far as I can tell, the issue happens since cited commit which\\nreordered tcf_block_offload_unbind() before tcf_block_flush_all_chains()\\nin __tcf_block_put(). The order cannot be reversed as the filter block\\nis expected to be freed after flushing all the chains.\\n\\n[1]\\nunreferenced object 0xffff888107e28800 (size 2048):\\n  comm \\\"tc\\\", pid 1079, jiffies 4294958525 (age 3074.287s)\\n  hex dump (first 32 bytes):\\n    b1 a6 7c 11 81 88 ff ff e0 5b b3 10 81 88 ff ff  ..|......[......\\n    01 00 00 00 00 00 00 00 e0 aa b0 84 ff ff ff ff  ................\\n  backtrace:\\n    [\u003cffffffff81c06a68\u003e] __kmem_cache_alloc_node+0x1e8/0x320\\n    [\u003cffffffff81ab374e\u003e] __kmalloc+0x4e/0x90\\n    [\u003cffffffff832aec6d\u003e] mlxsw_sp_acl_ruleset_get+0x34d/0x7a0\\n    [\u003cffffffff832bc195\u003e] mlxsw_sp_flower_tmplt_create+0x145/0x180\\n    [\u003cffffffff832b2e1a\u003e] mlxsw_sp_flow_block_cb+0x1ea/0x280\\n    [\u003cffffffff83a10613\u003e] tc_setup_cb_call+0x183/0x340\\n    [\u003cffffffff83a9f85a\u003e] fl_tmplt_create+0x3da/0x4c0\\n    [\u003cffffffff83a22435\u003e] tc_ctl_chain+0xa15/0x1170\\n    [\u003cffffffff838a863c\u003e] rtnetlink_rcv_msg+0x3cc/0xed0\\n    [\u003cffffffff83ac87f0\u003e] netlink_rcv_skb+0x170/0x440\\n    [\u003cffffffff83ac6270\u003e] netlink_unicast+0x540/0x820\\n    [\u003cffffffff83ac6e28\u003e] netlink_sendmsg+0x8d8/0xda0\\n    [\u003cffffffff83793def\u003e] ____sys_sendmsg+0x30f/0xa80\\n    [\u003cffffffff8379d29a\u003e] ___sys_sendmsg+0x13a/0x1e0\\n    [\u003cffffffff8379d50c\u003e] __sys_sendmsg+0x11c/0x1f0\\n    [\u003cffffffff843b9ce0\u003e] do_syscall_64+0x40/0xe0\\nunreferenced object 0xffff88816d2c0400 (size 1024):\\n  comm \\\"tc\\\", pid 1079, jiffies 4294958525 (age 3074.287s)\\n  hex dump (first 32 bytes):\\n    40 00 00 00 00 00 00 00 57 f6 38 be 00 00 00 00  @.......W.8.....\\n    10 04 2c 6d 81 88 ff ff 10 04 2c 6d 81 88 ff ff  ..,m......,m....\\n  backtrace:\\n    [\u003cffffffff81c06a68\u003e] __kmem_cache_alloc_node+0x1e8/0x320\\n    [\u003cffffffff81ab36c1\u003e] __kmalloc_node+0x51/0x90\\n    [\u003cffffffff81a8ed96\u003e] kvmalloc_node+0xa6/0x1f0\\n    [\u003cffffffff82827d03\u003e] bucket_table_alloc.isra.0+0x83/0x460\\n    [\u003cffffffff82828d2b\u003e] rhashtable_init+0x43b/0x7c0\\n    [\u003cffffffff832aed48\u003e] mlxsw_sp_acl_ruleset_get+0x428/0x7a0\\n    [\u003cffffffff832bc195\u003e] mlxsw_sp_flower_tmplt_create+0x145/0x180\\n    [\u003cffffffff832b2e1a\u003e] mlxsw_sp_flow_block_cb+0x1ea/0x280\\n    [\u003cffffffff83a10613\u003e] tc_setup_cb_call+0x183/0x340\\n    [\u003cffffffff83a9f85a\u003e] fl_tmplt_create+0x3da/0x4c0\\n    [\u003cffffffff83a22435\u003e] tc_ctl_chain+0xa15/0x1170\\n    [\u003cffffffff838a863c\u003e] rtnetlink_rcv_msg+0x3cc/0xed0\\n    [\u003cffffffff83ac87f0\u003e] netlink_rcv_skb+0x170/0x440\\n    [\u003cffffffff83ac6270\u003e] netlink_unicast+0x540/0x820\\n    [\u003cffffffff83ac6e28\u003e] netlink_sendmsg+0x8d8/0xda0\\n    [\u003cffffffff83793def\u003e] ____sys_sendmsg+0x30f/0xa80\\n\\n[2]\\n # tc qdisc add dev swp1 clsact\\n # tc chain add dev swp1 ingress proto ip chain 1 flower dst_ip 0.0.0.0/32\\n # tc qdisc del dev\\n---truncated---\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net/sched: flower: descarga de plantilla de cadena fija Cuando se elimina una qdisc de un dispositivo de red, la pila indica al controlador subyacente que elimine su devoluci\u00f3n de llamada de descarga de flujo del bloque de filtro asociado mediante el comando Comando \u0027FLOW_BLOCK_UNBIND\u0027. Luego, la pila contin\u00faa reproduciendo la eliminaci\u00f3n de los filtros en el bloque para este controlador iterando sobre las cadenas en el bloque e invocando la operaci\u00f3n de \\\"redescarga\\\" del clasificador que se est\u00e1 utilizando. A su vez, el clasificador en su operaci\u00f3n de \u0027redescarga\u0027 prepara y emite un comando \u0027FLOW_CLS_DESTROY\u0027 para cada filtro. Sin embargo, la pila no hace lo mismo con las plantillas de cadena y el controlador subyacente nunca recibe un comando \u0027FLOW_CLS_TMPLT_DESTROY\u0027 cuando se elimina una qdisc. Esto da como resultado una p\u00e9rdida de memoria [1] que se puede reproducir usando [2]. Para solucionarlo, introduzca una operaci\u00f3n \u0027tmplt_reoffload\u0027 y haga que la pila la invoque con los argumentos apropiados como parte de la reproducci\u00f3n. Implemente la operaci\u00f3n en el \u00fanico clasificador que admite plantillas de cadena (flor) emitiendo el comando \u0027FLOW_CLS_TMPLT_{CREATE,DESTROY}\u0027 en funci\u00f3n de si una devoluci\u00f3n de llamada de descarga de flujo est\u00e1 vinculada a un bloque de filtro o no est\u00e1 vinculada a uno. Por lo que puedo decir, el problema ocurre desde el commit que reorden\u00f3 tcf_block_offload_unbind() antes de tcf_block_flush_all_chains() en __tcf_block_put(). El orden no se puede invertir ya que se espera que el bloque del filtro se libere despu\u00e9s de lavar todas las cadenas. [1] objeto sin referencia 0xffff888107e28800 (tama\u00f1o 2048): comm \\\"tc\\\", pid 1079, jiffies 4294958525 (edad 3074.287s) volcado hexadecimal (primeros 32 bytes): b1 a6 7c 11 81 88 ff ff e0 5b b3 10 81 88 ff f ..|......[...... 01 00 00 00 00 00 00 00 e0 aa b0 84 ff ff ff ff ................ retroceso: [] __kmem_cache_alloc_node+0x1e8/0x320 [] __kmalloc+0x4e/0x90 [] mlxsw_sp_acl_ruleset_get+0x34d/0x7a0 [] mlxsw_sp_flower_tmplt_create+0x145/0x180 [] mlxsw_sp_flow_block_cb+0x1ea/0x280 [] tc_setup_cb_call+0x183/0x340 [] fl_tmplt_create+0x3da/0x4c0 [] tc_ctl_chain+0xa15/0x1170 [] rtnetlink_rcv_msg+0x3cc/0xed0 [] netlink_rcv_skb+0x170/0x440 [] netlink_unicast+0x540/0x820 [] netlink_sendmsg+0x8d8/0xda0 [] ____sys_sendmsg+0x30f/0xa80 [] ___sys_ enviarmsg+0x13a/0x1e0 [] __sys_sendmsg+0x11c/0x1f0 [] do_syscall_64+0x40/0xe0 objeto sin referencia 0xffff88816d2c0400 (tama\u00f1o 1024): comm \\\"tc\\\", pid 1079, santiam\u00e9n 4294958525 (edad 3074.287s) volcado hexadecimal (primeros 32 bytes): 40 00 00 00 00 00 00 00 57 f6 38 be 00 00 00 00 @.......W.8..... 10 04 2c 6d 81 88 ff ff 10 04 2c 6d 81 88 ff ff ..,m......, m.... retroceso: [] __kmem_cache_alloc_node+0x1e8/0x320 [] __kmalloc_node+0x51/0x90 [] kvmalloc_node+0xa6/0x1f0 [] bucket_table_alloc.isra.0+0x83/ 0x460 [] rhashtable_init+0x43b/0x7c0 [] mlxsw_sp_acl_ruleset_get+0x428/0x7a0 [] mlxsw_sp_flower_tmplt_create+0x145/0x180 [] mlxsw_sp_flow_block_cb+0x1ea/0x280 [] tc_setup_cb_call+0x183/ 0x340 [] fl_tmplt_create+0x3da/0x4c0 [] tc_ctl_chain+0xa15/0x1170 [] rtnetlink_rcv_msg+0x3cc/0xed0 [] netlink_rcv_skb+0x170/0x440 [] netlink_unicast+0x540/ 0x820 [] netlink_sendmsg+0x8d8/0xda0 [] ____sys_sendmsg+0x30f/0xa80 [2] # ---truncado---\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/32f2a0afa95fae0d1ceec2ff06e0e816939964b8\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9ed46144cff3598a5cf79955630e795ff9af5b97\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c04709b2cc99ae31c346f79f0211752d7b74df01\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...