cve-2024-35917
Vulnerability from cvelistv5
Published
2024-05-19 08:35
Modified
2024-12-19 08:58
Severity ?
EPSS score ?
0.16% (0.33582)
Summary
In the Linux kernel, the following vulnerability has been resolved: s390/bpf: Fix bpf_plt pointer arithmetic Kui-Feng Lee reported a crash on s390x triggered by the dummy_st_ops/dummy_init_ptr_arg test [1]: [<0000000000000002>] 0x2 [<00000000009d5cde>] bpf_struct_ops_test_run+0x156/0x250 [<000000000033145a>] __sys_bpf+0xa1a/0xd00 [<00000000003319dc>] __s390x_sys_bpf+0x44/0x50 [<0000000000c4382c>] __do_syscall+0x244/0x300 [<0000000000c59a40>] system_call+0x70/0x98 This is caused by GCC moving memcpy() after assignments in bpf_jit_plt(), resulting in NULL pointers being written instead of the return and the target addresses. Looking at the GCC internals, the reordering is allowed because the alias analysis thinks that the memcpy() destination and the assignments' left-hand-sides are based on different objects: new_plt and bpf_plt_ret/bpf_plt_target respectively, and therefore they cannot alias. This is in turn due to a violation of the C standard: When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object ... From the C's perspective, bpf_plt_ret and bpf_plt are distinct objects and cannot be subtracted. In the practical terms, doing so confuses the GCC's alias analysis. The code was written this way in order to let the C side know a few offsets defined in the assembly. While nice, this is by no means necessary. Fix the noncompliance by hardcoding these offsets. [1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/
Impacted products
Vendor Product Version
Linux Linux Version: f1d5df84cd8c3ec6460c78f5b86be7c84577a83f
Version: f1d5df84cd8c3ec6460c78f5b86be7c84577a83f
Version: f1d5df84cd8c3ec6460c78f5b86be7c84577a83f
Create a notification for this product.
   Linux Linux Version: 6.3
Create a notification for this product.
Show details on NVD website


{
   containers: {
      adp: [
         {
            metrics: [
               {
                  other: {
                     content: {
                        id: "CVE-2024-35917",
                        options: [
                           {
                              Exploitation: "none",
                           },
                           {
                              Automatable: "no",
                           },
                           {
                              "Technical Impact": "partial",
                           },
                        ],
                        role: "CISA Coordinator",
                        timestamp: "2024-06-17T17:38:36.152025Z",
                        version: "2.0.3",
                     },
                     type: "ssvc",
                  },
               },
            ],
            providerMetadata: {
               dateUpdated: "2024-06-17T17:41:11.520Z",
               orgId: "134c704f-9b21-4f2e-91b3-4a467353bcc0",
               shortName: "CISA-ADP",
            },
            title: "CISA ADP Vulnrichment",
         },
         {
            providerMetadata: {
               dateUpdated: "2024-08-02T03:21:49.000Z",
               orgId: "af854a3a-2127-422b-91ae-364da2661108",
               shortName: "CVE",
            },
            references: [
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb",
               },
            ],
            title: "CVE Program Container",
         },
      ],
      cna: {
         affected: [
            {
               defaultStatus: "unaffected",
               product: "Linux",
               programFiles: [
                  "arch/s390/net/bpf_jit_comp.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     lessThan: "c3062bdb859b6e2567e7f5c8cde20c0250bb130f",
                     status: "affected",
                     version: "f1d5df84cd8c3ec6460c78f5b86be7c84577a83f",
                     versionType: "git",
                  },
                  {
                     lessThan: "d3d74e45a060d218fe4b0c9174f0a77517509d8e",
                     status: "affected",
                     version: "f1d5df84cd8c3ec6460c78f5b86be7c84577a83f",
                     versionType: "git",
                  },
                  {
                     lessThan: "7ded842b356d151ece8ac4985940438e6d3998bb",
                     status: "affected",
                     version: "f1d5df84cd8c3ec6460c78f5b86be7c84577a83f",
                     versionType: "git",
                  },
               ],
            },
            {
               defaultStatus: "affected",
               product: "Linux",
               programFiles: [
                  "arch/s390/net/bpf_jit_comp.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     status: "affected",
                     version: "6.3",
                  },
                  {
                     lessThan: "6.3",
                     status: "unaffected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.6.*",
                     status: "unaffected",
                     version: "6.6.26",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.8.*",
                     status: "unaffected",
                     version: "6.8.5",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "*",
                     status: "unaffected",
                     version: "6.9",
                     versionType: "original_commit_for_fix",
                  },
               ],
            },
         ],
         descriptions: [
            {
               lang: "en",
               value: "In the Linux kernel, the following vulnerability has been resolved:\n\ns390/bpf: Fix bpf_plt pointer arithmetic\n\nKui-Feng Lee reported a crash on s390x triggered by the\ndummy_st_ops/dummy_init_ptr_arg test [1]:\n\n  [<0000000000000002>] 0x2\n  [<00000000009d5cde>] bpf_struct_ops_test_run+0x156/0x250\n  [<000000000033145a>] __sys_bpf+0xa1a/0xd00\n  [<00000000003319dc>] __s390x_sys_bpf+0x44/0x50\n  [<0000000000c4382c>] __do_syscall+0x244/0x300\n  [<0000000000c59a40>] system_call+0x70/0x98\n\nThis is caused by GCC moving memcpy() after assignments in\nbpf_jit_plt(), resulting in NULL pointers being written instead of\nthe return and the target addresses.\n\nLooking at the GCC internals, the reordering is allowed because the\nalias analysis thinks that the memcpy() destination and the assignments'\nleft-hand-sides are based on different objects: new_plt and\nbpf_plt_ret/bpf_plt_target respectively, and therefore they cannot\nalias.\n\nThis is in turn due to a violation of the C standard:\n\n  When two pointers are subtracted, both shall point to elements of the\n  same array object, or one past the last element of the array object\n  ...\n\nFrom the C's perspective, bpf_plt_ret and bpf_plt are distinct objects\nand cannot be subtracted. In the practical terms, doing so confuses the\nGCC's alias analysis.\n\nThe code was written this way in order to let the C side know a few\noffsets defined in the assembly. While nice, this is by no means\nnecessary. Fix the noncompliance by hardcoding these offsets.\n\n[1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/",
            },
         ],
         providerMetadata: {
            dateUpdated: "2024-12-19T08:58:14.236Z",
            orgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            shortName: "Linux",
         },
         references: [
            {
               url: "https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f",
            },
            {
               url: "https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e",
            },
            {
               url: "https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb",
            },
         ],
         title: "s390/bpf: Fix bpf_plt pointer arithmetic",
         x_generator: {
            engine: "bippy-5f407fcff5a0",
         },
      },
   },
   cveMetadata: {
      assignerOrgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      assignerShortName: "Linux",
      cveId: "CVE-2024-35917",
      datePublished: "2024-05-19T08:35:09.932Z",
      dateReserved: "2024-05-17T13:50:33.123Z",
      dateUpdated: "2024-12-19T08:58:14.236Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
   "vulnerability-lookup:meta": {
      nvd: "{\"cve\":{\"id\":\"CVE-2024-35917\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-19T09:15:12.150\",\"lastModified\":\"2024-11-21T09:21:12.103\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ns390/bpf: Fix bpf_plt pointer arithmetic\\n\\nKui-Feng Lee reported a crash on s390x triggered by the\\ndummy_st_ops/dummy_init_ptr_arg test [1]:\\n\\n  [<0000000000000002>] 0x2\\n  [<00000000009d5cde>] bpf_struct_ops_test_run+0x156/0x250\\n  [<000000000033145a>] __sys_bpf+0xa1a/0xd00\\n  [<00000000003319dc>] __s390x_sys_bpf+0x44/0x50\\n  [<0000000000c4382c>] __do_syscall+0x244/0x300\\n  [<0000000000c59a40>] system_call+0x70/0x98\\n\\nThis is caused by GCC moving memcpy() after assignments in\\nbpf_jit_plt(), resulting in NULL pointers being written instead of\\nthe return and the target addresses.\\n\\nLooking at the GCC internals, the reordering is allowed because the\\nalias analysis thinks that the memcpy() destination and the assignments'\\nleft-hand-sides are based on different objects: new_plt and\\nbpf_plt_ret/bpf_plt_target respectively, and therefore they cannot\\nalias.\\n\\nThis is in turn due to a violation of the C standard:\\n\\n  When two pointers are subtracted, both shall point to elements of the\\n  same array object, or one past the last element of the array object\\n  ...\\n\\nFrom the C's perspective, bpf_plt_ret and bpf_plt are distinct objects\\nand cannot be subtracted. In the practical terms, doing so confuses the\\nGCC's alias analysis.\\n\\nThe code was written this way in order to let the C side know a few\\noffsets defined in the assembly. While nice, this is by no means\\nnecessary. Fix the noncompliance by hardcoding these offsets.\\n\\n[1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvió la siguiente vulnerabilidad: s390/bpf: Corrección de la aritmética del puntero bpf_plt Kui-Feng Lee informó un bloqueo en s390x provocado por la prueba dummy_st_ops/dummy_init_ptr_arg [1]: [&lt;00000000000000002&gt;] 0x2 [&lt;00000000009d5cde&gt; ] bpf_struct_ops_test_run+0x156/0x250 [&lt;000000000033145a&gt;] __sys_bpf+0xa1a/0xd00 [&lt;00000000003319dc&gt;] __s390x_sys_bpf+0x44/0x50 [&lt;0000000000 c4382c&gt;] __do_syscall+0x244/0x300 [&lt;0000000000c59a40&gt;] system_call+0x70/0x98 Esto es causado por GCC mueve memcpy() después de las asignaciones en bpf_jit_plt(), lo que da como resultado que se escriban punteros NULL en lugar de las direcciones de retorno y de destino. Al observar los aspectos internos de GCC, se permite el reordenamiento porque el análisis de alias piensa que el destino memcpy() y los lados izquierdos de las asignaciones se basan en objetos diferentes: new_plt y bpf_plt_ret/bpf_plt_target respectivamente y, por lo tanto, no pueden crear alias. Esto, a su vez, se debe a una violación del estándar C: cuando se restan dos punteros, ambos apuntarán a elementos del mismo objeto de matriz, o uno más allá del último elemento del objeto de matriz... Desde la perspectiva de C, bpf_plt_ret y bpf_plt son objetos distintos y no se pueden restar. En términos prácticos, hacerlo confunde el análisis de alias del CCG. El código se escribió de esta manera para que el lado C conozca algunas compensaciones definidas en el ensamblaje. Si bien es agradable, esto no es necesario. Corrija el incumplimiento codificando estas compensaciones. [1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
      vulnrichment: {
         containers: "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T03:21:49.000Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-35917\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-06-17T17:38:36.152025Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-06-17T17:38:37.184Z\"}}], \"cna\": {\"title\": \"s390/bpf: Fix bpf_plt pointer arithmetic\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"f1d5df84cd8c3ec6460c78f5b86be7c84577a83f\", \"lessThan\": \"c3062bdb859b6e2567e7f5c8cde20c0250bb130f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"f1d5df84cd8c3ec6460c78f5b86be7c84577a83f\", \"lessThan\": \"d3d74e45a060d218fe4b0c9174f0a77517509d8e\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"f1d5df84cd8c3ec6460c78f5b86be7c84577a83f\", \"lessThan\": \"7ded842b356d151ece8ac4985940438e6d3998bb\", \"versionType\": \"git\"}], \"programFiles\": [\"arch/s390/net/bpf_jit_comp.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.3\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.3\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.6.26\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.8.5\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"arch/s390/net/bpf_jit_comp.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/c3062bdb859b6e2567e7f5c8cde20c0250bb130f\"}, {\"url\": \"https://git.kernel.org/stable/c/d3d74e45a060d218fe4b0c9174f0a77517509d8e\"}, {\"url\": \"https://git.kernel.org/stable/c/7ded842b356d151ece8ac4985940438e6d3998bb\"}], \"x_generator\": {\"engine\": \"bippy-5f407fcff5a0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\ns390/bpf: Fix bpf_plt pointer arithmetic\\n\\nKui-Feng Lee reported a crash on s390x triggered by the\\ndummy_st_ops/dummy_init_ptr_arg test [1]:\\n\\n  [<0000000000000002>] 0x2\\n  [<00000000009d5cde>] bpf_struct_ops_test_run+0x156/0x250\\n  [<000000000033145a>] __sys_bpf+0xa1a/0xd00\\n  [<00000000003319dc>] __s390x_sys_bpf+0x44/0x50\\n  [<0000000000c4382c>] __do_syscall+0x244/0x300\\n  [<0000000000c59a40>] system_call+0x70/0x98\\n\\nThis is caused by GCC moving memcpy() after assignments in\\nbpf_jit_plt(), resulting in NULL pointers being written instead of\\nthe return and the target addresses.\\n\\nLooking at the GCC internals, the reordering is allowed because the\\nalias analysis thinks that the memcpy() destination and the assignments'\\nleft-hand-sides are based on different objects: new_plt and\\nbpf_plt_ret/bpf_plt_target respectively, and therefore they cannot\\nalias.\\n\\nThis is in turn due to a violation of the C standard:\\n\\n  When two pointers are subtracted, both shall point to elements of the\\n  same array object, or one past the last element of the array object\\n  ...\\n\\nFrom the C's perspective, bpf_plt_ret and bpf_plt are distinct objects\\nand cannot be subtracted. In the practical terms, doing so confuses the\\nGCC's alias analysis.\\n\\nThe code was written this way in order to let the C side know a few\\noffsets defined in the assembly. While nice, this is by no means\\nnecessary. Fix the noncompliance by hardcoding these offsets.\\n\\n[1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-12-19T08:58:14.236Z\"}}}",
         cveMetadata: "{\"cveId\": \"CVE-2024-35917\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-12-19T08:58:14.236Z\", \"dateReserved\": \"2024-05-17T13:50:33.123Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-19T08:35:09.932Z\", \"assignerShortName\": \"Linux\"}",
         dataType: "CVE_RECORD",
         dataVersion: "5.1",
      },
   },
}


Log in or create an account to share your comment.

Security Advisory comment format.

This schema specifies the format of a comment related to a security advisory.

UUIDv4 of the comment
UUIDv4 of the Vulnerability-Lookup instance
When the comment was created originally
When the comment was last updated
Title of the comment
Description of the comment
The identifier of the vulnerability (CVE ID, GHSA-ID, PYSEC ID, etc.).



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.