CVE-2024-50140 (GCVE-0-2024-50140)
Vulnerability from cvelistv5
Published
2024-11-07 09:31
Modified
2025-10-01 20:27
Summary
In the Linux kernel, the following vulnerability has been resolved: sched/core: Disable page allocation in task_tick_mm_cid() With KASAN and PREEMPT_RT enabled, calling task_work_add() in task_tick_mm_cid() may cause the following splat. [ 63.696416] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 [ 63.696416] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 610, name: modprobe [ 63.696416] preempt_count: 10001, expected: 0 [ 63.696416] RCU nest depth: 1, expected: 1 This problem is caused by the following call trace. sched_tick() [ acquire rq->__lock ] -> task_tick_mm_cid() -> task_work_add() -> __kasan_record_aux_stack() -> kasan_save_stack() -> stack_depot_save_flags() -> alloc_pages_mpol_noprof() -> __alloc_pages_noprof() -> get_page_from_freelist() -> rmqueue() -> rmqueue_pcplist() -> __rmqueue_pcplist() -> rmqueue_bulk() -> rt_spin_lock() The rq lock is a raw_spinlock_t. We can't sleep while holding it. IOW, we can't call alloc_pages() in stack_depot_save_flags(). The task_tick_mm_cid() function with its task_work_add() call was introduced by commit 223baf9d17f2 ("sched: Fix performance regression introduced by mm_cid") in v6.4 kernel. Fortunately, there is a kasan_record_aux_stack_noalloc() variant that calls stack_depot_save_flags() while not allowing it to allocate new pages. To allow task_tick_mm_cid() to use task_work without page allocation, a new TWAF_NO_ALLOC flag is added to enable calling kasan_record_aux_stack_noalloc() instead of kasan_record_aux_stack() if set. The task_tick_mm_cid() function is modified to add this new flag. The possible downside is the missing stack trace in a KASAN report due to new page allocation required when task_work_add_noallloc() is called which should be rare.
Impacted products
Vendor Product Version
Linux Linux Version: 223baf9d17f25e2608dbdff7232c095c1e612268
Version: 223baf9d17f25e2608dbdff7232c095c1e612268
Version: 223baf9d17f25e2608dbdff7232c095c1e612268
Create a notification for this product.
   Linux Linux Version: 6.4
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 5.5,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "NONE",
              "integrityImpact": "NONE",
              "privilegesRequired": "LOW",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-50140",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-10-01T20:21:10.724441Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "description": "CWE-noinfo Not enough information",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-10-01T20:27:14.428Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/linux/task_work.h",
            "kernel/sched/core.c",
            "kernel/task_work.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "509c29d0d26f68a6f6d0a05cb1a89725237e2b87",
              "status": "affected",
              "version": "223baf9d17f25e2608dbdff7232c095c1e612268",
              "versionType": "git"
            },
            {
              "lessThan": "ce0241ef83eed55f675376e8a3605d23de53d875",
              "status": "affected",
              "version": "223baf9d17f25e2608dbdff7232c095c1e612268",
              "versionType": "git"
            },
            {
              "lessThan": "73ab05aa46b02d96509cb029a8d04fca7bbde8c7",
              "status": "affected",
              "version": "223baf9d17f25e2608dbdff7232c095c1e612268",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/linux/task_work.h",
            "kernel/sched/core.c",
            "kernel/task_work.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.4"
            },
            {
              "lessThan": "6.4",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.59",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.11.*",
              "status": "unaffected",
              "version": "6.11.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.12",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.59",
                  "versionStartIncluding": "6.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.11.6",
                  "versionStartIncluding": "6.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12",
                  "versionStartIncluding": "6.4",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nsched/core: Disable page allocation in task_tick_mm_cid()\n\nWith KASAN and PREEMPT_RT enabled, calling task_work_add() in\ntask_tick_mm_cid() may cause the following splat.\n\n[   63.696416] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48\n[   63.696416] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 610, name: modprobe\n[   63.696416] preempt_count: 10001, expected: 0\n[   63.696416] RCU nest depth: 1, expected: 1\n\nThis problem is caused by the following call trace.\n\n  sched_tick() [ acquire rq-\u003e__lock ]\n   -\u003e task_tick_mm_cid()\n    -\u003e task_work_add()\n     -\u003e __kasan_record_aux_stack()\n      -\u003e kasan_save_stack()\n       -\u003e stack_depot_save_flags()\n        -\u003e alloc_pages_mpol_noprof()\n         -\u003e __alloc_pages_noprof()\n\t  -\u003e get_page_from_freelist()\n\t   -\u003e rmqueue()\n\t    -\u003e rmqueue_pcplist()\n\t     -\u003e __rmqueue_pcplist()\n\t      -\u003e rmqueue_bulk()\n\t       -\u003e rt_spin_lock()\n\nThe rq lock is a raw_spinlock_t. We can\u0027t sleep while holding\nit. IOW, we can\u0027t call alloc_pages() in stack_depot_save_flags().\n\nThe task_tick_mm_cid() function with its task_work_add() call was\nintroduced by commit 223baf9d17f2 (\"sched: Fix performance regression\nintroduced by mm_cid\") in v6.4 kernel.\n\nFortunately, there is a kasan_record_aux_stack_noalloc() variant that\ncalls stack_depot_save_flags() while not allowing it to allocate\nnew pages.  To allow task_tick_mm_cid() to use task_work without\npage allocation, a new TWAF_NO_ALLOC flag is added to enable calling\nkasan_record_aux_stack_noalloc() instead of kasan_record_aux_stack()\nif set. The task_tick_mm_cid() function is modified to add this new flag.\n\nThe possible downside is the missing stack trace in a KASAN report due\nto new page allocation required when task_work_add_noallloc() is called\nwhich should be rare."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T09:47:05.069Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/509c29d0d26f68a6f6d0a05cb1a89725237e2b87"
        },
        {
          "url": "https://git.kernel.org/stable/c/ce0241ef83eed55f675376e8a3605d23de53d875"
        },
        {
          "url": "https://git.kernel.org/stable/c/73ab05aa46b02d96509cb029a8d04fca7bbde8c7"
        }
      ],
      "title": "sched/core: Disable page allocation in task_tick_mm_cid()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-50140",
    "datePublished": "2024-11-07T09:31:17.379Z",
    "dateReserved": "2024-10-21T19:36:19.956Z",
    "dateUpdated": "2025-10-01T20:27:14.428Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-50140\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-11-07T10:15:05.980\",\"lastModified\":\"2025-10-01T21:15:52.277\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nsched/core: Disable page allocation in task_tick_mm_cid()\\n\\nWith KASAN and PREEMPT_RT enabled, calling task_work_add() in\\ntask_tick_mm_cid() may cause the following splat.\\n\\n[   63.696416] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48\\n[   63.696416] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 610, name: modprobe\\n[   63.696416] preempt_count: 10001, expected: 0\\n[   63.696416] RCU nest depth: 1, expected: 1\\n\\nThis problem is caused by the following call trace.\\n\\n  sched_tick() [ acquire rq-\u003e__lock ]\\n   -\u003e task_tick_mm_cid()\\n    -\u003e task_work_add()\\n     -\u003e __kasan_record_aux_stack()\\n      -\u003e kasan_save_stack()\\n       -\u003e stack_depot_save_flags()\\n        -\u003e alloc_pages_mpol_noprof()\\n         -\u003e __alloc_pages_noprof()\\n\\t  -\u003e get_page_from_freelist()\\n\\t   -\u003e rmqueue()\\n\\t    -\u003e rmqueue_pcplist()\\n\\t     -\u003e __rmqueue_pcplist()\\n\\t      -\u003e rmqueue_bulk()\\n\\t       -\u003e rt_spin_lock()\\n\\nThe rq lock is a raw_spinlock_t. We can\u0027t sleep while holding\\nit. IOW, we can\u0027t call alloc_pages() in stack_depot_save_flags().\\n\\nThe task_tick_mm_cid() function with its task_work_add() call was\\nintroduced by commit 223baf9d17f2 (\\\"sched: Fix performance regression\\nintroduced by mm_cid\\\") in v6.4 kernel.\\n\\nFortunately, there is a kasan_record_aux_stack_noalloc() variant that\\ncalls stack_depot_save_flags() while not allowing it to allocate\\nnew pages.  To allow task_tick_mm_cid() to use task_work without\\npage allocation, a new TWAF_NO_ALLOC flag is added to enable calling\\nkasan_record_aux_stack_noalloc() instead of kasan_record_aux_stack()\\nif set. The task_tick_mm_cid() function is modified to add this new flag.\\n\\nThe possible downside is the missing stack trace in a KASAN report due\\nto new page allocation required when task_work_add_noallloc() is called\\nwhich should be rare.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: sched/core: Deshabilitar la asignaci\u00f3n de p\u00e1ginas en task_tick_mm_cid() Con KASAN y PREEMPT_RT habilitados, llamar a task_work_add() en task_tick_mm_cid() puede causar el siguiente splat. [ 63.696416] ERROR: funci\u00f3n inactiva llamada desde un contexto no v\u00e1lido en kernel/locking/spinlock_rt.c:48 [ 63.696416] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 610, name: modprobe [ 63.696416] preempt_count: 10001, esperado: 0 [ 63.696416] Profundidad de anidaci\u00f3n de RCU: 1, esperado: 1 Este problema es causado por el siguiente seguimiento de llamada. sched_tick() [ adquirir rq-\u0026gt;__lock ] -\u0026gt; task_tick_mm_cid() -\u0026gt; task_work_add() -\u0026gt; __kasan_record_aux_stack() -\u0026gt; kasan_save_stack() -\u0026gt; stack_depot_save_flags() -\u0026gt; alloc_pages_mpol_noprof() -\u0026gt; __alloc_pages_noprof() -\u0026gt; get_page_from_freelist() -\u0026gt; rmqueue() -\u0026gt; rmqueue_pcplist() -\u0026gt; __rmqueue_pcplist() -\u0026gt; rmqueue_bulk() -\u0026gt; rt_spin_lock() El bloqueo rq es un raw_spinlock_t. No podemos dormir mientras lo mantenemos. Es decir, no podemos llamar a alloc_pages() en stack_depot_save_flags(). La funci\u00f3n task_tick_mm_cid() con su llamada task_work_add() fue introducida por el commit 223baf9d17f2 (\\\"sched: Fix performance regression presented by mm_cid\\\") en el kernel v6.4. Afortunadamente, hay una variante kasan_record_aux_stack_noalloc() que llama a stack_depot_save_flags() pero no le permite asignar nuevas p\u00e1ginas. Para permitir que task_tick_mm_cid() use task_work sin asignaci\u00f3n de p\u00e1ginas, se agrega un nuevo indicador TWAF_NO_ALLOC para habilitar la llamada a kasan_record_aux_stack_noalloc() en lugar de kasan_record_aux_stack() si est\u00e1 configurado. La funci\u00f3n task_tick_mm_cid() se modifica para agregar este nuevo indicador. La posible desventaja es la falta de seguimiento de pila en un informe KASAN debido a la nueva asignaci\u00f3n de p\u00e1gina requerida cuando se llama a task_work_add_noallloc(), lo que deber\u00eda ser poco com\u00fan.\"}],\"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:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6},{\"source\":\"134c704f-9b21-4f2e-91b3-4a467353bcc0\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.4\",\"versionEndExcluding\":\"6.6.59\",\"matchCriteriaId\":\"F0663E1D-0BCE-4D24-BFE4-F9C52687DD40\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.7\",\"versionEndExcluding\":\"6.11.6\",\"matchCriteriaId\":\"E4486B12-007B-4794-9857-F07145637AA1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"7F361E1D-580F-4A2D-A509-7615F73167A1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"925478D0-3E3D-4E6F-ACD5-09F28D5DF82C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.12:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"3C95E234-D335-4B6C-96BF-E2CEBD8654ED\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/509c29d0d26f68a6f6d0a05cb1a89725237e2b87\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/73ab05aa46b02d96509cb029a8d04fca7bbde8c7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/ce0241ef83eed55f675376e8a3605d23de53d875\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.5, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"NONE\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-50140\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-10-01T20:21:10.724441Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"description\": \"CWE-noinfo Not enough information\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-10-01T15:17:13.029Z\"}}], \"cna\": {\"title\": \"sched/core: Disable page allocation in task_tick_mm_cid()\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"223baf9d17f25e2608dbdff7232c095c1e612268\", \"lessThan\": \"509c29d0d26f68a6f6d0a05cb1a89725237e2b87\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"223baf9d17f25e2608dbdff7232c095c1e612268\", \"lessThan\": \"ce0241ef83eed55f675376e8a3605d23de53d875\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"223baf9d17f25e2608dbdff7232c095c1e612268\", \"lessThan\": \"73ab05aa46b02d96509cb029a8d04fca7bbde8c7\", \"versionType\": \"git\"}], \"programFiles\": [\"include/linux/task_work.h\", \"kernel/sched/core.c\", \"kernel/task_work.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.4\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.4\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.6.59\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.11.6\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.11.*\"}, {\"status\": \"unaffected\", \"version\": \"6.12\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"include/linux/task_work.h\", \"kernel/sched/core.c\", \"kernel/task_work.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/509c29d0d26f68a6f6d0a05cb1a89725237e2b87\"}, {\"url\": \"https://git.kernel.org/stable/c/ce0241ef83eed55f675376e8a3605d23de53d875\"}, {\"url\": \"https://git.kernel.org/stable/c/73ab05aa46b02d96509cb029a8d04fca7bbde8c7\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nsched/core: Disable page allocation in task_tick_mm_cid()\\n\\nWith KASAN and PREEMPT_RT enabled, calling task_work_add() in\\ntask_tick_mm_cid() may cause the following splat.\\n\\n[   63.696416] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48\\n[   63.696416] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 610, name: modprobe\\n[   63.696416] preempt_count: 10001, expected: 0\\n[   63.696416] RCU nest depth: 1, expected: 1\\n\\nThis problem is caused by the following call trace.\\n\\n  sched_tick() [ acquire rq-\u003e__lock ]\\n   -\u003e task_tick_mm_cid()\\n    -\u003e task_work_add()\\n     -\u003e __kasan_record_aux_stack()\\n      -\u003e kasan_save_stack()\\n       -\u003e stack_depot_save_flags()\\n        -\u003e alloc_pages_mpol_noprof()\\n         -\u003e __alloc_pages_noprof()\\n\\t  -\u003e get_page_from_freelist()\\n\\t   -\u003e rmqueue()\\n\\t    -\u003e rmqueue_pcplist()\\n\\t     -\u003e __rmqueue_pcplist()\\n\\t      -\u003e rmqueue_bulk()\\n\\t       -\u003e rt_spin_lock()\\n\\nThe rq lock is a raw_spinlock_t. We can\u0027t sleep while holding\\nit. IOW, we can\u0027t call alloc_pages() in stack_depot_save_flags().\\n\\nThe task_tick_mm_cid() function with its task_work_add() call was\\nintroduced by commit 223baf9d17f2 (\\\"sched: Fix performance regression\\nintroduced by mm_cid\\\") in v6.4 kernel.\\n\\nFortunately, there is a kasan_record_aux_stack_noalloc() variant that\\ncalls stack_depot_save_flags() while not allowing it to allocate\\nnew pages.  To allow task_tick_mm_cid() to use task_work without\\npage allocation, a new TWAF_NO_ALLOC flag is added to enable calling\\nkasan_record_aux_stack_noalloc() instead of kasan_record_aux_stack()\\nif set. The task_tick_mm_cid() function is modified to add this new flag.\\n\\nThe possible downside is the missing stack trace in a KASAN report due\\nto new page allocation required when task_work_add_noallloc() is called\\nwhich should be rare.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.59\", \"versionStartIncluding\": \"6.4\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.11.6\", \"versionStartIncluding\": \"6.4\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.12\", \"versionStartIncluding\": \"6.4\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T09:47:05.069Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-50140\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-10-01T20:27:14.428Z\", \"dateReserved\": \"2024-10-21T19:36:19.956Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-11-07T09:31:17.379Z\", \"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.


Loading…