cve-2024-53222
Vulnerability from cvelistv5
Published
2024-12-27 13:50
Modified
2025-01-20 06:21
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: zram: fix NULL pointer in comp_algorithm_show() LTP reported a NULL pointer dereference as followed: CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: loaded Not tainted 6.12.0-rc6+ #3 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __pi_strcmp+0x24/0x140 lr : zcomp_available_show+0x60/0x100 [zram] sp : ffff800088b93b90 x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0 x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 0000000000000000 x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900 x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: ffff80007b3e2900 x9 : ffff80007b3cb280 x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c x2 : 0000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000 Call trace: __pi_strcmp+0x24/0x140 comp_algorithm_show+0x40/0x70 [zram] dev_attr_show+0x28/0x80 sysfs_kf_seq_show+0x90/0x140 kernfs_seq_show+0x34/0x48 seq_read_iter+0x1d4/0x4e8 kernfs_fop_read_iter+0x40/0x58 new_sync_read+0x9c/0x168 vfs_read+0x1a8/0x1f8 ksys_read+0x74/0x108 __arm64_sys_read+0x24/0x38 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0xc8/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x38/0x138 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x188/0x190 The zram->comp_algs[ZRAM_PRIMARY_COMP] can be NULL in zram_add() if comp_algorithm_set() has not been called. User can access the zram device by sysfs after device_add_disk(), so there is a time window to trigger the NULL pointer dereference. Move it ahead device_add_disk() to make sure when user can access the zram device, it is ready. comp_algorithm_set() is protected by zram->init_lock in other places and no such problem.
Impacted products
Vendor Product Version
Linux Linux Version: 7ac07a26dea79c3892436bce41cce03dcbd3c4c7
Version: 7ac07a26dea79c3892436bce41cce03dcbd3c4c7
Create a notification for this product.
   Linux Linux Version: 6.2
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/block/zram/zram_drv.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "843d366ff19708668d95cda16bb8aba109a93dba",
              "status": "affected",
              "version": "7ac07a26dea79c3892436bce41cce03dcbd3c4c7",
              "versionType": "git"
            },
            {
              "lessThan": "f364cdeb38938f9d03061682b8ff3779dd1730e5",
              "status": "affected",
              "version": "7ac07a26dea79c3892436bce41cce03dcbd3c4c7",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/block/zram/zram_drv.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.2"
            },
            {
              "lessThan": "6.2",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nzram: fix NULL pointer in comp_algorithm_show()\n\nLTP reported a NULL pointer dereference as followed:\n\n CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: loaded Not tainted 6.12.0-rc6+ #3\n Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015\n pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)\n pc : __pi_strcmp+0x24/0x140\n lr : zcomp_available_show+0x60/0x100 [zram]\n sp : ffff800088b93b90\n x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0\n x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 0000000000000000\n x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900\n x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000\n x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000\n x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000\n x11: 0000000000000000 x10: ffff80007b3e2900 x9 : ffff80007b3cb280\n x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000\n x5 : 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c\n x2 : 0000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000\n Call trace:\n  __pi_strcmp+0x24/0x140\n  comp_algorithm_show+0x40/0x70 [zram]\n  dev_attr_show+0x28/0x80\n  sysfs_kf_seq_show+0x90/0x140\n  kernfs_seq_show+0x34/0x48\n  seq_read_iter+0x1d4/0x4e8\n  kernfs_fop_read_iter+0x40/0x58\n  new_sync_read+0x9c/0x168\n  vfs_read+0x1a8/0x1f8\n  ksys_read+0x74/0x108\n  __arm64_sys_read+0x24/0x38\n  invoke_syscall+0x50/0x120\n  el0_svc_common.constprop.0+0xc8/0xf0\n  do_el0_svc+0x24/0x38\n  el0_svc+0x38/0x138\n  el0t_64_sync_handler+0xc0/0xc8\n  el0t_64_sync+0x188/0x190\n\nThe zram-\u003ecomp_algs[ZRAM_PRIMARY_COMP] can be NULL in zram_add() if\ncomp_algorithm_set() has not been called.  User can access the zram device\nby sysfs after device_add_disk(), so there is a time window to trigger the\nNULL pointer dereference.  Move it ahead device_add_disk() to make sure\nwhen user can access the zram device, it is ready.  comp_algorithm_set()\nis protected by zram-\u003einit_lock in other places and no such problem."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-01-20T06:21:32.565Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/843d366ff19708668d95cda16bb8aba109a93dba"
        },
        {
          "url": "https://git.kernel.org/stable/c/f364cdeb38938f9d03061682b8ff3779dd1730e5"
        }
      ],
      "title": "zram: fix NULL pointer in comp_algorithm_show()",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-53222",
    "datePublished": "2024-12-27T13:50:12.652Z",
    "dateReserved": "2024-11-19T17:17:25.024Z",
    "dateUpdated": "2025-01-20T06:21:32.565Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-53222\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-12-27T14:15:30.327\",\"lastModified\":\"2025-01-08T21:25:39.027\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nzram: fix NULL pointer in comp_algorithm_show()\\n\\nLTP reported a NULL pointer dereference as followed:\\n\\n CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: loaded Not tainted 6.12.0-rc6+ #3\\n Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015\\n pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)\\n pc : __pi_strcmp+0x24/0x140\\n lr : zcomp_available_show+0x60/0x100 [zram]\\n sp : ffff800088b93b90\\n x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0\\n x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 0000000000000000\\n x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900\\n x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000\\n x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000\\n x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000\\n x11: 0000000000000000 x10: ffff80007b3e2900 x9 : ffff80007b3cb280\\n x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000\\n x5 : 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c\\n x2 : 0000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000\\n Call trace:\\n  __pi_strcmp+0x24/0x140\\n  comp_algorithm_show+0x40/0x70 [zram]\\n  dev_attr_show+0x28/0x80\\n  sysfs_kf_seq_show+0x90/0x140\\n  kernfs_seq_show+0x34/0x48\\n  seq_read_iter+0x1d4/0x4e8\\n  kernfs_fop_read_iter+0x40/0x58\\n  new_sync_read+0x9c/0x168\\n  vfs_read+0x1a8/0x1f8\\n  ksys_read+0x74/0x108\\n  __arm64_sys_read+0x24/0x38\\n  invoke_syscall+0x50/0x120\\n  el0_svc_common.constprop.0+0xc8/0xf0\\n  do_el0_svc+0x24/0x38\\n  el0_svc+0x38/0x138\\n  el0t_64_sync_handler+0xc0/0xc8\\n  el0t_64_sync+0x188/0x190\\n\\nThe zram-\u003ecomp_algs[ZRAM_PRIMARY_COMP] can be NULL in zram_add() if\\ncomp_algorithm_set() has not been called.  User can access the zram device\\nby sysfs after device_add_disk(), so there is a time window to trigger the\\nNULL pointer dereference.  Move it ahead device_add_disk() to make sure\\nwhen user can access the zram device, it is ready.  comp_algorithm_set()\\nis protected by zram-\u003einit_lock in other places and no such problem.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: zram: arregla el puntero NULL en comp_algorithm_show() LTP inform\u00f3 una desreferencia de puntero NULL de la siguiente manera: CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: cargado No contaminado 6.12.0-rc6+ #3 Nombre del hardware: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __pi_strcmp+0x24/0x140 lr : zcomp_available_show+0x60/0x100 [zram] sp : ffff800088b93b90 x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0 x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 00000000000000000 x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900 x20: 0000000000000000 x19: 00000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: ffff80007b3e2900 x9: ffff80007b3cb280 x8: 0101010101010101 x7: 0000000000000000 x6: 0000000000000000 x5: 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c x2 : 000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000 Rastreo de llamadas: __pi_strcmp+0x24/0x140 comp_algorithm_show+0x40/0x70 [zram] dev_attr_show+0x28/0x80 sysfs_kf_seq_show+0x90/0x140 kernfs_seq_show+0x34/0x48 seq_read_iter+0x1d4/0x4e8 El zram-\u0026gt;comp_algs[ZRAM_PRIMARY_COMP] puede ser NULL en zram_add() si No se ha llamado a comp_algorithm_set(). El usuario puede acceder al dispositivo zram mediante sysfs despu\u00e9s de device_add_disk(), por lo que hay una ventana de tiempo para activar la desreferencia del puntero NULL. Mu\u00e9valo hacia delante en device_add_disk() para asegurarse de que cuando el usuario pueda acceder al dispositivo zram, est\u00e9 listo. comp_algorithm_set() est\u00e1 protegido por zram-\u0026gt;init_lock en otros lugares y no existe ese problema.\"}],\"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}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-476\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.2\",\"versionEndExcluding\":\"6.12.2\",\"matchCriteriaId\":\"F21702AB-90B0-49AB-83E6-29B799AF41C7\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/843d366ff19708668d95cda16bb8aba109a93dba\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/f364cdeb38938f9d03061682b8ff3779dd1730e5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


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.