cve-2022-48921
Vulnerability from cvelistv5
Published
2024-08-22 01:32
Modified
2024-12-19 08:10
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: sched/fair: Fix fault in reweight_entity Syzbot found a GPF in reweight_entity. This has been bisected to commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group") There is a race between sched_post_fork() and setpriority(PRIO_PGRP) within a thread group that causes a null-ptr-deref in reweight_entity() in CFS. The scenario is that the main process spawns number of new threads, which then call setpriority(PRIO_PGRP, 0, -20), wait, and exit. For each of the new threads the copy_process() gets invoked, which adds the new task_struct and calls sched_post_fork() for it. In the above scenario there is a possibility that setpriority(PRIO_PGRP) and set_one_prio() will be called for a thread in the group that is just being created by copy_process(), and for which the sched_post_fork() has not been executed yet. This will trigger a null pointer dereference in reweight_entity(), as it will try to access the run queue pointer, which hasn't been set. Before the mentioned change the cfs_rq pointer for the task has been set in sched_fork(), which is called much earlier in copy_process(), before the new task is added to the thread_group. Now it is done in the sched_post_fork(), which is called after that. To fix the issue the remove the update_load param from the update_load param() function and call reweight_task() only if the task flag doesn't have the TASK_NEW flag set.
Impacted products
Vendor Product Version
Linux Linux Version: c85c6fadbef0a3eab41540ea628fa8fe8928c820
Version: 3869eecf050416a1d19bac60926f6b5d64b0aa58
Version: 4ef0c5c6b5ba1f38f0ea1cedad0cad722f00c14a
Version: 4ef0c5c6b5ba1f38f0ea1cedad0cad722f00c14a
Create a notification for this product.
   Linux Linux Version: 5.16
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2022-48921",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T15:33:28.558357Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-12T17:33:01.045Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "kernel/sched/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "8f317cd888059c59e2fa924bf4b0957cfa53f78e",
              "status": "affected",
              "version": "c85c6fadbef0a3eab41540ea628fa8fe8928c820",
              "versionType": "git"
            },
            {
              "lessThan": "e0bcd6b5779352aed88f2e538a82a39f1a7715bb",
              "status": "affected",
              "version": "3869eecf050416a1d19bac60926f6b5d64b0aa58",
              "versionType": "git"
            },
            {
              "lessThan": "589a954daab5e18399860b6c8ffaeaf79844eb20",
              "status": "affected",
              "version": "4ef0c5c6b5ba1f38f0ea1cedad0cad722f00c14a",
              "versionType": "git"
            },
            {
              "lessThan": "13765de8148f71fa795e0a6607de37c49ea5915a",
              "status": "affected",
              "version": "4ef0c5c6b5ba1f38f0ea1cedad0cad722f00c14a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "kernel/sched/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.16"
            },
            {
              "lessThan": "5.16",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.137",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.27",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.16.*",
              "status": "unaffected",
              "version": "5.16.13",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nsched/fair: Fix fault in reweight_entity\n\nSyzbot found a GPF in reweight_entity. This has been bisected to\ncommit 4ef0c5c6b5ba (\"kernel/sched: Fix sched_fork() access an invalid\nsched_task_group\")\n\nThere\u00a0is a race between sched_post_fork() and setpriority(PRIO_PGRP)\nwithin a thread group that causes a null-ptr-deref\u00a0in\nreweight_entity() in CFS. The scenario is that the main process spawns\nnumber of new threads, which then call setpriority(PRIO_PGRP, 0, -20),\nwait, and exit.  For each of the new threads the copy_process() gets\ninvoked, which adds the new task_struct and calls sched_post_fork()\nfor it.\n\nIn the above scenario there is a possibility that\nsetpriority(PRIO_PGRP) and set_one_prio() will be called for a thread\nin the group that is just being created by copy_process(), and for\nwhich the sched_post_fork() has not been executed yet. This will\ntrigger a null pointer dereference in reweight_entity(),\u00a0as it will\ntry to access the run queue pointer, which hasn\u0027t been set.\n\nBefore the mentioned change the cfs_rq pointer for the task  has been\nset in sched_fork(), which is called much earlier in copy_process(),\nbefore the new task is added to the thread_group.  Now it is done in\nthe sched_post_fork(), which is called after that.  To fix the issue\nthe remove the update_load param from the update_load param() function\nand call reweight_task() only if the task flag doesn\u0027t have the\nTASK_NEW flag set."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-12-19T08:10:33.303Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/8f317cd888059c59e2fa924bf4b0957cfa53f78e"
        },
        {
          "url": "https://git.kernel.org/stable/c/e0bcd6b5779352aed88f2e538a82a39f1a7715bb"
        },
        {
          "url": "https://git.kernel.org/stable/c/589a954daab5e18399860b6c8ffaeaf79844eb20"
        },
        {
          "url": "https://git.kernel.org/stable/c/13765de8148f71fa795e0a6607de37c49ea5915a"
        }
      ],
      "title": "sched/fair: Fix fault in reweight_entity",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-48921",
    "datePublished": "2024-08-22T01:32:53.131Z",
    "dateReserved": "2024-08-21T06:06:23.295Z",
    "dateUpdated": "2024-12-19T08:10:33.303Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-48921\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-08-22T02:15:08.197\",\"lastModified\":\"2024-09-12T12:58:50.660\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nsched/fair: Fix fault in reweight_entity\\n\\nSyzbot found a GPF in reweight_entity. This has been bisected to\\ncommit 4ef0c5c6b5ba (\\\"kernel/sched: Fix sched_fork() access an invalid\\nsched_task_group\\\")\\n\\nThere\u00a0is a race between sched_post_fork() and setpriority(PRIO_PGRP)\\nwithin a thread group that causes a null-ptr-deref\u00a0in\\nreweight_entity() in CFS. The scenario is that the main process spawns\\nnumber of new threads, which then call setpriority(PRIO_PGRP, 0, -20),\\nwait, and exit.  For each of the new threads the copy_process() gets\\ninvoked, which adds the new task_struct and calls sched_post_fork()\\nfor it.\\n\\nIn the above scenario there is a possibility that\\nsetpriority(PRIO_PGRP) and set_one_prio() will be called for a thread\\nin the group that is just being created by copy_process(), and for\\nwhich the sched_post_fork() has not been executed yet. This will\\ntrigger a null pointer dereference in reweight_entity(),\u00a0as it will\\ntry to access the run queue pointer, which hasn\u0027t been set.\\n\\nBefore the mentioned change the cfs_rq pointer for the task  has been\\nset in sched_fork(), which is called much earlier in copy_process(),\\nbefore the new task is added to the thread_group.  Now it is done in\\nthe sched_post_fork(), which is called after that.  To fix the issue\\nthe remove the update_load param from the update_load param() function\\nand call reweight_task() only if the task flag doesn\u0027t have the\\nTASK_NEW flag set.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: sched/fair: Solucionar falla en reweight_entity Syzbot encontr\u00f3 un GPF en reweight_entity. Esto se ha dividido en dos para el commit 4ef0c5c6b5ba (\\\"kernel/sched: Fix sched_fork() accede a un sched_task_group no v\u00e1lido\\\") Hay una ejecuci\u00f3n entre sched_post_fork() y setpriority(PRIO_PGRP) dentro de un grupo de subprocesos que provoca un null-ptr-deref en reweight_entity () en el SFC. El escenario es que el proceso principal genera una cantidad de subprocesos nuevos, que luego llaman a setpriority(PRIO_PGRP, 0, -20), esperan y salen. Para cada uno de los nuevos subprocesos, se invoca copy_process(), lo que agrega la nueva task_struct y llama a sched_post_fork() para ello. En el escenario anterior existe la posibilidad de que se llame a setpriority(PRIO_PGRP) y set_one_prio() para un subproceso en el grupo que acaba de crear copy_process(), y para el cual sched_post_fork() a\u00fan no se ha ejecutado. Esto desencadenar\u00e1 una desreferencia del puntero nulo en reweight_entity(), ya que intentar\u00e1 acceder al puntero de la cola de ejecuci\u00f3n, que no se ha configurado. Antes del cambio mencionado, el puntero cfs_rq para la tarea se configur\u00f3 en sched_fork(), que se llama mucho antes en copy_process(), antes de que la nueva tarea se agregue al thread_group. Ahora se hace en sched_post_fork(), que se llama despu\u00e9s de eso. Para solucionar el problema, elimine el par\u00e1metro update_load de la funci\u00f3n update_load param() y llame a reweight_task() solo si el indicador de tarea no tiene establecido el indicador TASK_NEW.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":4.7,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"HIGH\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.0,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-362\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.10.80\",\"versionEndExcluding\":\"5.10.137\",\"matchCriteriaId\":\"82480749-56E0-4A46-85BF-C3C44B1F8706\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.14.19\",\"versionEndExcluding\":\"5.15\",\"matchCriteriaId\":\"CC24A46F-AAF0-46A3-9255-D235078D50BC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.15.3\",\"versionEndExcluding\":\"5.15.27\",\"matchCriteriaId\":\"61C603D7-C7CD-4505-AF1B-EBFDD4D152AF\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.16\",\"versionEndExcluding\":\"5.16.13\",\"matchCriteriaId\":\"B871B667-EDC0-435D-909E-E918D8D90995\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"7BD5F8D9-54FA-4CB0-B4F0-CB0471FDDB2D\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"E6E34B23-78B4-4516-9BD8-61B33F4AC49A\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"C030FA3D-03F4-4FB9-9DBF-D08E5CAC51AA\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/13765de8148f71fa795e0a6607de37c49ea5915a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/589a954daab5e18399860b6c8ffaeaf79844eb20\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/8f317cd888059c59e2fa924bf4b0957cfa53f78e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/e0bcd6b5779352aed88f2e538a82a39f1a7715bb\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2022-48921\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-10T15:33:28.558357Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-11T12:42:12.752Z\"}}], \"cna\": {\"title\": \"sched/fair: Fix fault in reweight_entity\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"c85c6fadbef0\", \"lessThan\": \"8f317cd88805\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"3869eecf0504\", \"lessThan\": \"e0bcd6b57793\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"4ef0c5c6b5ba\", \"lessThan\": \"589a954daab5\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"4ef0c5c6b5ba\", \"lessThan\": \"13765de8148f\", \"versionType\": \"git\"}], \"programFiles\": [\"kernel/sched/core.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.16\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.16\", \"versionType\": \"custom\"}, {\"status\": \"unaffected\", \"version\": \"5.10.137\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.27\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"5.16.13\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.16.*\"}, {\"status\": \"unaffected\", \"version\": \"5.17\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"kernel/sched/core.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/8f317cd888059c59e2fa924bf4b0957cfa53f78e\"}, {\"url\": \"https://git.kernel.org/stable/c/e0bcd6b5779352aed88f2e538a82a39f1a7715bb\"}, {\"url\": \"https://git.kernel.org/stable/c/589a954daab5e18399860b6c8ffaeaf79844eb20\"}, {\"url\": \"https://git.kernel.org/stable/c/13765de8148f71fa795e0a6607de37c49ea5915a\"}], \"x_generator\": {\"engine\": \"bippy-c9c4e1df01b2\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nsched/fair: Fix fault in reweight_entity\\n\\nSyzbot found a GPF in reweight_entity. This has been bisected to\\ncommit 4ef0c5c6b5ba (\\\"kernel/sched: Fix sched_fork() access an invalid\\nsched_task_group\\\")\\n\\nThere\\u00a0is a race between sched_post_fork() and setpriority(PRIO_PGRP)\\nwithin a thread group that causes a null-ptr-deref\\u00a0in\\nreweight_entity() in CFS. The scenario is that the main process spawns\\nnumber of new threads, which then call setpriority(PRIO_PGRP, 0, -20),\\nwait, and exit.  For each of the new threads the copy_process() gets\\ninvoked, which adds the new task_struct and calls sched_post_fork()\\nfor it.\\n\\nIn the above scenario there is a possibility that\\nsetpriority(PRIO_PGRP) and set_one_prio() will be called for a thread\\nin the group that is just being created by copy_process(), and for\\nwhich the sched_post_fork() has not been executed yet. This will\\ntrigger a null pointer dereference in reweight_entity(),\\u00a0as it will\\ntry to access the run queue pointer, which hasn\u0027t been set.\\n\\nBefore the mentioned change the cfs_rq pointer for the task  has been\\nset in sched_fork(), which is called much earlier in copy_process(),\\nbefore the new task is added to the thread_group.  Now it is done in\\nthe sched_post_fork(), which is called after that.  To fix the issue\\nthe remove the update_load param from the update_load param() function\\nand call reweight_task() only if the task flag doesn\u0027t have the\\nTASK_NEW flag set.\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-08-22T03:31:08.679Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2022-48921\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-09-12T17:33:01.045Z\", \"dateReserved\": \"2024-08-21T06:06:23.295Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-08-22T01:32:53.131Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


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.