cve-2024-42096
Vulnerability from cvelistv5
Published
2024-07-29 17:39
Modified
2024-11-05 09:37
Severity ?
Summary
x86: stop playing stack games in profile_pc()
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T04:54:32.567Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/65ebdde16e7f5da99dbf8a548fb635837d78384e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/27c3be840911b15a3f24ed623f86153c825b6b29"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/49c09ca35a5f521d7fa18caf62fdf378f15e8aa4"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/2d07fea561d64357fb7b3f3751e653bf20306d77"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/161cef818545ecf980f0e2ebaf8ba7326ce53c2b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/16222beb9f8e5ceb0beeb5cbe54bef16df501a92"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a3b65c8cbc139bfce9541bc81c1bb766e5ba3f68"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/093d9603b60093a9aaae942db56107f6432a5dca"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-42096",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T16:18:21.628470Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:00.264Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/kernel/time.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "65ebdde16e7f",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "27c3be840911",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "49c09ca35a5f",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "2d07fea561d6",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "161cef818545",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "16222beb9f8e",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "a3b65c8cbc13",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "093d9603b600",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/kernel/time.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.317",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.279",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.221",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.162",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.97",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.37",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.9.*",
              "status": "unaffected",
              "version": "6.9.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.10",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nx86: stop playing stack games in profile_pc()\n\nThe \u0027profile_pc()\u0027 function is used for timer-based profiling, which\nisn\u0027t really all that relevant any more to begin with, but it also ends\nup making assumptions based on the stack layout that aren\u0027t necessarily\nvalid.\n\nBasically, the code tries to account the time spent in spinlocks to the\ncaller rather than the spinlock, and while I support that as a concept,\nit\u0027s not worth the code complexity or the KASAN warnings when no serious\nprofiling is done using timers anyway these days.\n\nAnd the code really does depend on stack layout that is only true in the\nsimplest of cases.  We\u0027ve lost the comment at some point (I think when\nthe 32-bit and 64-bit code was unified), but it used to say:\n\n\tAssume the lock function has either no stack frame or a copy\n\tof eflags from PUSHF.\n\nwhich explains why it just blindly loads a word or two straight off the\nstack pointer and then takes a minimal look at the values to just check\nif they might be eflags or the return pc:\n\n\tEflags always has bits 22 and up cleared unlike kernel addresses\n\nbut that basic stack layout assumption assumes that there isn\u0027t any lock\ndebugging etc going on that would complicate the code and cause a stack\nframe.\n\nIt causes KASAN unhappiness reported for years by syzkaller [1] and\nothers [2].\n\nWith no real practical reason for this any more, just remove the code.\n\nJust for historical interest, here\u0027s some background commits relating to\nthis code from 2006:\n\n  0cb91a229364 (\"i386: Account spinlocks to the caller during profiling for !FP kernels\")\n  31679f38d886 (\"Simplify profile_pc on x86-64\")\n\nand a code unification from 2009:\n\n  ef4512882dbe (\"x86: time_32/64.c unify profile_pc\")\n\nbut the basics of this thing actually goes back to before the git tree."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-05T09:37:19.720Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/65ebdde16e7f5da99dbf8a548fb635837d78384e"
        },
        {
          "url": "https://git.kernel.org/stable/c/27c3be840911b15a3f24ed623f86153c825b6b29"
        },
        {
          "url": "https://git.kernel.org/stable/c/49c09ca35a5f521d7fa18caf62fdf378f15e8aa4"
        },
        {
          "url": "https://git.kernel.org/stable/c/2d07fea561d64357fb7b3f3751e653bf20306d77"
        },
        {
          "url": "https://git.kernel.org/stable/c/161cef818545ecf980f0e2ebaf8ba7326ce53c2b"
        },
        {
          "url": "https://git.kernel.org/stable/c/16222beb9f8e5ceb0beeb5cbe54bef16df501a92"
        },
        {
          "url": "https://git.kernel.org/stable/c/a3b65c8cbc139bfce9541bc81c1bb766e5ba3f68"
        },
        {
          "url": "https://git.kernel.org/stable/c/093d9603b60093a9aaae942db56107f6432a5dca"
        }
      ],
      "title": "x86: stop playing stack games in profile_pc()",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-42096",
    "datePublished": "2024-07-29T17:39:31.620Z",
    "dateReserved": "2024-07-29T15:50:41.173Z",
    "dateUpdated": "2024-11-05T09:37:19.720Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-42096\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-07-29T18:15:12.087\",\"lastModified\":\"2024-07-30T13:33:30.653\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nx86: stop playing stack games in profile_pc()\\n\\nThe \u0027profile_pc()\u0027 function is used for timer-based profiling, which\\nisn\u0027t really all that relevant any more to begin with, but it also ends\\nup making assumptions based on the stack layout that aren\u0027t necessarily\\nvalid.\\n\\nBasically, the code tries to account the time spent in spinlocks to the\\ncaller rather than the spinlock, and while I support that as a concept,\\nit\u0027s not worth the code complexity or the KASAN warnings when no serious\\nprofiling is done using timers anyway these days.\\n\\nAnd the code really does depend on stack layout that is only true in the\\nsimplest of cases.  We\u0027ve lost the comment at some point (I think when\\nthe 32-bit and 64-bit code was unified), but it used to say:\\n\\n\\tAssume the lock function has either no stack frame or a copy\\n\\tof eflags from PUSHF.\\n\\nwhich explains why it just blindly loads a word or two straight off the\\nstack pointer and then takes a minimal look at the values to just check\\nif they might be eflags or the return pc:\\n\\n\\tEflags always has bits 22 and up cleared unlike kernel addresses\\n\\nbut that basic stack layout assumption assumes that there isn\u0027t any lock\\ndebugging etc going on that would complicate the code and cause a stack\\nframe.\\n\\nIt causes KASAN unhappiness reported for years by syzkaller [1] and\\nothers [2].\\n\\nWith no real practical reason for this any more, just remove the code.\\n\\nJust for historical interest, here\u0027s some background commits relating to\\nthis code from 2006:\\n\\n  0cb91a229364 (\\\"i386: Account spinlocks to the caller during profiling for !FP kernels\\\")\\n  31679f38d886 (\\\"Simplify profile_pc on x86-64\\\")\\n\\nand a code unification from 2009:\\n\\n  ef4512882dbe (\\\"x86: time_32/64.c unify profile_pc\\\")\\n\\nbut the basics of this thing actually goes back to before the git tree.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: x86: deja de jugar juegos de pila en perfil_pc() La funci\u00f3n \u0027profile_pc()\u0027 se utiliza para la creaci\u00f3n de perfiles basada en temporizador, lo cual ya no es tan relevante para empezar. , pero tambi\u00e9n termina haciendo suposiciones basadas en el dise\u00f1o de la pila que no son necesariamente v\u00e1lidas. B\u00e1sicamente, el c\u00f3digo intenta contabilizar el tiempo invertido en bloqueos de giro para la persona que llama en lugar del bloqueo de giro, y si bien apoyo eso como concepto, no vale la pena la complejidad del c\u00f3digo o las advertencias de KASAN cuando de todos modos no se realiza una creaci\u00f3n de perfiles seria usando temporizadores en estos d\u00edas. . Y el c\u00f3digo realmente depende del dise\u00f1o de la pila, lo que solo es cierto en los casos m\u00e1s simples. Perdimos el comentario en alg\u00fan momento (creo que cuando se unific\u00f3 el c\u00f3digo de 32 y 64 bits), pero sol\u00eda decir: Supongamos que la funci\u00f3n de bloqueo no tiene marco de pila o tiene una copia de eflags de PUSHF. lo que explica por qu\u00e9 simplemente carga ciegamente una o dos palabras directamente desde el puntero de la pila y luego echa un vistazo m\u00ednimo a los valores para comprobar si podr\u00edan ser eflags o la PC de retorno: Eflags siempre tiene los bits 22 y superiores limpios, a diferencia de las direcciones del kernel, pero Esa suposici\u00f3n b\u00e1sica del dise\u00f1o de la pila supone que no hay ninguna depuraci\u00f3n de bloqueo, etc., que complicar\u00eda el c\u00f3digo y provocar\u00eda un marco de pila. Provoca la infelicidad de KASAN que Syzkaller [1] y otros [2] han informado durante a\u00f1os. Sin ninguna raz\u00f3n pr\u00e1ctica real para esto, simplemente elimine el c\u00f3digo. Solo por inter\u00e9s hist\u00f3rico, aqu\u00ed hay algunas confirmaciones de antecedentes relacionadas con este c\u00f3digo de 2006: 0cb91a229364 (\\\"i386: La cuenta se bloquea en la persona que llama durante la creaci\u00f3n de perfiles para los n\u00facleos !FP\\\") 31679f38d886 (\\\"Simplificar perfil_pc en x86-64\\\") y una unificaci\u00f3n de c\u00f3digo de 2009: ef4512882dbe (\\\"x86: time_32/64.c unify perfil_pc\\\") pero los conceptos b\u00e1sicos de esto en realidad se remontan a antes del \u00e1rbol git.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/093d9603b60093a9aaae942db56107f6432a5dca\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/161cef818545ecf980f0e2ebaf8ba7326ce53c2b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/16222beb9f8e5ceb0beeb5cbe54bef16df501a92\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/27c3be840911b15a3f24ed623f86153c825b6b29\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/2d07fea561d64357fb7b3f3751e653bf20306d77\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/49c09ca35a5f521d7fa18caf62fdf378f15e8aa4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/65ebdde16e7f5da99dbf8a548fb635837d78384e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a3b65c8cbc139bfce9541bc81c1bb766e5ba3f68\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...
  • 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.