CVE-2023-52705
Vulnerability from cvelistv5
Published
2024-05-21 15:22
Modified
2024-11-04 14:51
Severity ?
Summary
nilfs2: fix underflow in second superblock position calculations
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-52705",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-21T17:32:06.834863Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:23:07.362Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T23:11:34.922Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/2f7a1135b202977b82457adde7db6c390056863b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/b96591e2c35c8b47db0ec816b5fc6cb8868000ff"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/52844d8382cd9166d708032def8905ffc3ae550f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/0ee5ed0126a2211f7174492da2ca2c29f43755c5"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a158782b56b070485d54d25fc9aaf2c8f3752205"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a8ef5109f93cea9933bbac0455d8c18757b3fcb4"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/99b9402a36f0799f25feee4465bfa4b8dfa74b4d"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/nilfs2/ioctl.c",
            "fs/nilfs2/super.c",
            "fs/nilfs2/the_nilfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "2f7a1135b202",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "b96591e2c35c",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "52844d8382cd",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "0ee5ed0126a2",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "a158782b56b0",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "a8ef5109f93c",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            },
            {
              "lessThan": "99b9402a36f0",
              "status": "affected",
              "version": "1da177e4c3f4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/nilfs2/ioctl.c",
            "fs/nilfs2/super.c",
            "fs/nilfs2/the_nilfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.306",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.273",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.232",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.169",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.95",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.13",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix underflow in second superblock position calculations\n\nMacro NILFS_SB2_OFFSET_BYTES, which computes the position of the second\nsuperblock, underflows when the argument device size is less than 4096\nbytes.  Therefore, when using this macro, it is necessary to check in\nadvance that the device size is not less than a lower limit, or at least\nthat underflow does not occur.\n\nThe current nilfs2 implementation lacks this check, causing out-of-bound\nblock access when mounting devices smaller than 4096 bytes:\n\n I/O error, dev loop0, sector 36028797018963960 op 0x0:(READ) flags 0x0\n phys_seg 1 prio class 2\n NILFS (loop0): unable to read secondary superblock (blocksize = 1024)\n\nIn addition, when trying to resize the filesystem to a size below 4096\nbytes, this underflow occurs in nilfs_resize_fs(), passing a huge number\nof segments to nilfs_sufile_resize(), corrupting parameters such as the\nnumber of segments in superblocks.  This causes excessive loop iterations\nin nilfs_sufile_resize() during a subsequent resize ioctl, causing\nsemaphore ns_segctor_sem to block for a long time and hang the writer\nthread:\n\n INFO: task segctord:5067 blocked for more than 143 seconds.\n      Not tainted 6.2.0-rc8-syzkaller-00015-gf6feea56f66d #0\n \"echo 0 \u003e /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\n task:segctord        state:D stack:23456 pid:5067  ppid:2\n flags:0x00004000\n Call Trace:\n  \u003cTASK\u003e\n  context_switch kernel/sched/core.c:5293 [inline]\n  __schedule+0x1409/0x43f0 kernel/sched/core.c:6606\n  schedule+0xc3/0x190 kernel/sched/core.c:6682\n  rwsem_down_write_slowpath+0xfcf/0x14a0 kernel/locking/rwsem.c:1190\n  nilfs_transaction_lock+0x25c/0x4f0 fs/nilfs2/segment.c:357\n  nilfs_segctor_thread_construct fs/nilfs2/segment.c:2486 [inline]\n  nilfs_segctor_thread+0x52f/0x1140 fs/nilfs2/segment.c:2570\n  kthread+0x270/0x300 kernel/kthread.c:376\n  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308\n  \u003c/TASK\u003e\n ...\n Call Trace:\n  \u003cTASK\u003e\n  folio_mark_accessed+0x51c/0xf00 mm/swap.c:515\n  __nilfs_get_page_block fs/nilfs2/page.c:42 [inline]\n  nilfs_grab_buffer+0x3d3/0x540 fs/nilfs2/page.c:61\n  nilfs_mdt_submit_block+0xd7/0x8f0 fs/nilfs2/mdt.c:121\n  nilfs_mdt_read_block+0xeb/0x430 fs/nilfs2/mdt.c:176\n  nilfs_mdt_get_block+0x12d/0xbb0 fs/nilfs2/mdt.c:251\n  nilfs_sufile_get_segment_usage_block fs/nilfs2/sufile.c:92 [inline]\n  nilfs_sufile_truncate_range fs/nilfs2/sufile.c:679 [inline]\n  nilfs_sufile_resize+0x7a3/0x12b0 fs/nilfs2/sufile.c:777\n  nilfs_resize_fs+0x20c/0xed0 fs/nilfs2/super.c:422\n  nilfs_ioctl_resize fs/nilfs2/ioctl.c:1033 [inline]\n  nilfs_ioctl+0x137c/0x2440 fs/nilfs2/ioctl.c:1301\n  ...\n\nThis fixes these issues by inserting appropriate minimum device size\nchecks or anti-underflow checks, depending on where the macro is used."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-04T14:51:32.108Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/2f7a1135b202977b82457adde7db6c390056863b"
        },
        {
          "url": "https://git.kernel.org/stable/c/b96591e2c35c8b47db0ec816b5fc6cb8868000ff"
        },
        {
          "url": "https://git.kernel.org/stable/c/52844d8382cd9166d708032def8905ffc3ae550f"
        },
        {
          "url": "https://git.kernel.org/stable/c/0ee5ed0126a2211f7174492da2ca2c29f43755c5"
        },
        {
          "url": "https://git.kernel.org/stable/c/a158782b56b070485d54d25fc9aaf2c8f3752205"
        },
        {
          "url": "https://git.kernel.org/stable/c/a8ef5109f93cea9933bbac0455d8c18757b3fcb4"
        },
        {
          "url": "https://git.kernel.org/stable/c/99b9402a36f0799f25feee4465bfa4b8dfa74b4d"
        }
      ],
      "title": "nilfs2: fix underflow in second superblock position calculations",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-52705",
    "datePublished": "2024-05-21T15:22:54.015Z",
    "dateReserved": "2024-03-07T14:49:46.891Z",
    "dateUpdated": "2024-11-04T14:51:32.108Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-52705\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-21T16:15:12.840\",\"lastModified\":\"2024-05-21T16:53:56.550\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnilfs2: fix underflow in second superblock position calculations\\n\\nMacro NILFS_SB2_OFFSET_BYTES, which computes the position of the second\\nsuperblock, underflows when the argument device size is less than 4096\\nbytes.  Therefore, when using this macro, it is necessary to check in\\nadvance that the device size is not less than a lower limit, or at least\\nthat underflow does not occur.\\n\\nThe current nilfs2 implementation lacks this check, causing out-of-bound\\nblock access when mounting devices smaller than 4096 bytes:\\n\\n I/O error, dev loop0, sector 36028797018963960 op 0x0:(READ) flags 0x0\\n phys_seg 1 prio class 2\\n NILFS (loop0): unable to read secondary superblock (blocksize = 1024)\\n\\nIn addition, when trying to resize the filesystem to a size below 4096\\nbytes, this underflow occurs in nilfs_resize_fs(), passing a huge number\\nof segments to nilfs_sufile_resize(), corrupting parameters such as the\\nnumber of segments in superblocks.  This causes excessive loop iterations\\nin nilfs_sufile_resize() during a subsequent resize ioctl, causing\\nsemaphore ns_segctor_sem to block for a long time and hang the writer\\nthread:\\n\\n INFO: task segctord:5067 blocked for more than 143 seconds.\\n      Not tainted 6.2.0-rc8-syzkaller-00015-gf6feea56f66d #0\\n \\\"echo 0 \u003e /proc/sys/kernel/hung_task_timeout_secs\\\" disables this message.\\n task:segctord        state:D stack:23456 pid:5067  ppid:2\\n flags:0x00004000\\n Call Trace:\\n  \u003cTASK\u003e\\n  context_switch kernel/sched/core.c:5293 [inline]\\n  __schedule+0x1409/0x43f0 kernel/sched/core.c:6606\\n  schedule+0xc3/0x190 kernel/sched/core.c:6682\\n  rwsem_down_write_slowpath+0xfcf/0x14a0 kernel/locking/rwsem.c:1190\\n  nilfs_transaction_lock+0x25c/0x4f0 fs/nilfs2/segment.c:357\\n  nilfs_segctor_thread_construct fs/nilfs2/segment.c:2486 [inline]\\n  nilfs_segctor_thread+0x52f/0x1140 fs/nilfs2/segment.c:2570\\n  kthread+0x270/0x300 kernel/kthread.c:376\\n  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308\\n  \u003c/TASK\u003e\\n ...\\n Call Trace:\\n  \u003cTASK\u003e\\n  folio_mark_accessed+0x51c/0xf00 mm/swap.c:515\\n  __nilfs_get_page_block fs/nilfs2/page.c:42 [inline]\\n  nilfs_grab_buffer+0x3d3/0x540 fs/nilfs2/page.c:61\\n  nilfs_mdt_submit_block+0xd7/0x8f0 fs/nilfs2/mdt.c:121\\n  nilfs_mdt_read_block+0xeb/0x430 fs/nilfs2/mdt.c:176\\n  nilfs_mdt_get_block+0x12d/0xbb0 fs/nilfs2/mdt.c:251\\n  nilfs_sufile_get_segment_usage_block fs/nilfs2/sufile.c:92 [inline]\\n  nilfs_sufile_truncate_range fs/nilfs2/sufile.c:679 [inline]\\n  nilfs_sufile_resize+0x7a3/0x12b0 fs/nilfs2/sufile.c:777\\n  nilfs_resize_fs+0x20c/0xed0 fs/nilfs2/super.c:422\\n  nilfs_ioctl_resize fs/nilfs2/ioctl.c:1033 [inline]\\n  nilfs_ioctl+0x137c/0x2440 fs/nilfs2/ioctl.c:1301\\n  ...\\n\\nThis fixes these issues by inserting appropriate minimum device size\\nchecks or anti-underflow checks, depending on where the macro is used.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: nilfs2: corrige el desbordamiento en los c\u00e1lculos de la posici\u00f3n del segundo superbloque. La macro NILFS_SB2_OFFSET_BYTES, que calcula la posici\u00f3n del segundo superbloque, sufre un desbordamiento cuando el tama\u00f1o del dispositivo del argumento es inferior a 4096 bytes. Por lo tanto, al utilizar esta macro, es necesario comprobar de antemano que el tama\u00f1o del dispositivo no sea inferior a un l\u00edmite inferior, o al menos que no se produzca un desbordamiento insuficiente. La implementaci\u00f3n actual de nilfs2 carece de esta verificaci\u00f3n, lo que provoca un acceso a bloques fuera de los l\u00edmites al montar dispositivos de menos de 4096 bytes: error de E/S, dev loop0, sector 36028797018963960 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 NILFS (loop0 ): no se puede leer el superbloque secundario (tama\u00f1o de bloque = 1024) Adem\u00e1s, al intentar cambiar el tama\u00f1o del sistema de archivos a un tama\u00f1o inferior a 4096 bytes, este desbordamiento se produce en nilfs_resize_fs(), pasando una gran cantidad de segmentos a nilfs_sufile_resize(), corrompiendo par\u00e1metros como como el n\u00famero de segmentos en supermanzanas. Esto provoca iteraciones de bucle excesivas en nilfs_sufile_resize() durante un cambio de tama\u00f1o de ioctl posterior, lo que provoca que el sem\u00e1foro ns_segctor_sem se bloquee durante mucho tiempo y cuelgue el hilo de escritura: INFORMACI\u00d3N: tarea segctord:5067 bloqueada durante m\u00e1s de 143 segundos. No contaminado 6.2.0-rc8-syzkaller-00015-gf6feea56f66d #0 \\\"echo 0 \u0026gt; /proc/sys/kernel/hung_task_timeout_secs\\\" desactiva este mensaje. tarea:segctord estado:D pila:23456 pid:5067 ppid:2 banderas:0x00004000 Seguimiento de llamadas:  context_switch kernel/sched/core.c:5293 [en l\u00ednea] __schedule+0x1409/0x43f0 kernel/sched/core.c: 6606 programaci\u00f3n+0xc3/0x190 kernel/sched/core.c:6682 rwsem_down_write_slowpath+0xfcf/0x14a0 kernel/locking/rwsem.c:1190 nilfs_transaction_lock+0x25c/0x4f0 fs/nilfs2/segment.c:357 nilfs_segctor_thread_construct fs /nilfs2/segmento. c:2486 [en l\u00ednea] nilfs_segctor_thread+0x52f/0x1140 fs/nilfs2/segment.c:2570 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 ... Seguimiento de llamadas:  folio_mark_accessed+0x51c/0xf00 mm/swap.c:515 __nilfs_get_page_block fs/nilfs2/page.c:42 [en l\u00ednea] nilfs_grab_buffer+0x3d3/0x540 fs/nilfs2/page.c:61 nilfs_mdt_submit_block+0xd7/0x8f0 fs/nilfs2/mdt.c:121 nilfs_mdt_read_block+0xeb/0x430 fs/nilfs2/mdt.c:176 nilfs_mdt_get_block+0x12d/0xbb0 fs/nilfs2/mdt.c:251 _get_segment_usage_block fs/nilfs2/sufile.c :92 [en l\u00ednea] nilfs_sufile_truncate_range fs/nilfs2/sufile.c:679 [en l\u00ednea] nilfs_sufile_resize+0x7a3/0x12b0 fs/nilfs2/sufile.c:777 nilfs_resize_fs+0x20c/0xed0 fs/nilfs2/super.c:422 nilfs_ioctl_resize f s/nilfs2 /ioctl.c:1033 [en l\u00ednea] nilfs_ioctl+0x137c/0x2440 fs/nilfs2/ioctl.c:1301 ... Esto soluciona estos problemas insertando comprobaciones de tama\u00f1o m\u00ednimo de dispositivo adecuadas o comprobaciones anti-desbordamiento, dependiendo de d\u00f3nde se utilice la macro .\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0ee5ed0126a2211f7174492da2ca2c29f43755c5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/2f7a1135b202977b82457adde7db6c390056863b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/52844d8382cd9166d708032def8905ffc3ae550f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/99b9402a36f0799f25feee4465bfa4b8dfa74b4d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a158782b56b070485d54d25fc9aaf2c8f3752205\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a8ef5109f93cea9933bbac0455d8c18757b3fcb4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b96591e2c35c8b47db0ec816b5fc6cb8868000ff\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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.