cve-2024-26935
Vulnerability from cvelistv5
Published
2024-05-01 05:17
Modified
2024-11-05 09:18
Severity ?
Summary
scsi: core: Fix unremoved procfs host directory regression
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-26935",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-21T14:41:52.902192Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-21T14:42:04.057Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T00:21:05.717Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/hosts.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "0053f15d50d5",
              "status": "affected",
              "version": "88c3d3bb6469",
              "versionType": "git"
            },
            {
              "lessThan": "5c2386ba80e7",
              "status": "affected",
              "version": "68c665bb1850",
              "versionType": "git"
            },
            {
              "lessThan": "cea234bb214b",
              "status": "affected",
              "version": "2a764d55e938",
              "versionType": "git"
            },
            {
              "lessThan": "3678cf67ff71",
              "status": "affected",
              "version": "7e0ae8667fcd",
              "versionType": "git"
            },
            {
              "lessThan": "d4c34782b6d7",
              "status": "affected",
              "version": "be03df3d4bfe",
              "versionType": "git"
            },
            {
              "lessThan": "e293c773c13b",
              "status": "affected",
              "version": "be03df3d4bfe",
              "versionType": "git"
            },
            {
              "lessThan": "f4ff08fab66e",
              "status": "affected",
              "version": "be03df3d4bfe",
              "versionType": "git"
            },
            {
              "lessThan": "f23a4d6e0757",
              "status": "affected",
              "version": "be03df3d4bfe",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/hosts.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.3"
            },
            {
              "lessThan": "6.3",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.274",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.215",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.154",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.84",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.24",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: core: Fix unremoved procfs host directory regression\n\nCommit fc663711b944 (\"scsi: core: Remove the /proc/scsi/${proc_name}\ndirectory earlier\") fixed a bug related to modules loading/unloading, by\nadding a call to scsi_proc_hostdir_rm() on scsi_remove_host(). But that led\nto a potential duplicate call to the hostdir_rm() routine, since it\u0027s also\ncalled from scsi_host_dev_release(). That triggered a regression report,\nwhich was then fixed by commit be03df3d4bfe (\"scsi: core: Fix a procfs host\ndirectory removal regression\"). The fix just dropped the hostdir_rm() call\nfrom dev_release().\n\nBut it happens that this proc directory is created on scsi_host_alloc(),\nand that function \"pairs\" with scsi_host_dev_release(), while\nscsi_remove_host() pairs with scsi_add_host(). In other words, it seems the\nreason for removing the proc directory on dev_release() was meant to cover\ncases in which a SCSI host structure was allocated, but the call to\nscsi_add_host() didn\u0027t happen. And that pattern happens to exist in some\nerror paths, for example.\n\nSyzkaller causes that by using USB raw gadget device, error\u0027ing on\nusb-storage driver, at usb_stor_probe2(). By checking that path, we can see\nthat the BadDevice label leads to a scsi_host_put() after a SCSI host\nallocation, but there\u0027s no call to scsi_add_host() in such path. That leads\nto messages like this in dmesg (and a leak of the SCSI host proc\nstructure):\n\nusb-storage 4-1:87.51: USB Mass Storage device detected\nproc_dir_entry \u0027scsi/usb-storage\u0027 already registered\nWARNING: CPU: 1 PID: 3519 at fs/proc/generic.c:377 proc_register+0x347/0x4e0 fs/proc/generic.c:376\n\nThe proper fix seems to still call scsi_proc_hostdir_rm() on dev_release(),\nbut guard that with the state check for SHOST_CREATED; there is even a\ncomment in scsi_host_dev_release() detailing that: such conditional is\nmeant for cases where the SCSI host was allocated but there was no calls to\n{add,remove}_host(), like the usb-storage case.\n\nThis is what we propose here and with that, the error path of usb-storage\ndoes not trigger the warning anymore."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-11-05T09:18:29.305Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac"
        },
        {
          "url": "https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1"
        },
        {
          "url": "https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee"
        },
        {
          "url": "https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889"
        },
        {
          "url": "https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c"
        },
        {
          "url": "https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320"
        },
        {
          "url": "https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7"
        },
        {
          "url": "https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84"
        }
      ],
      "title": "scsi: core: Fix unremoved procfs host directory regression",
      "x_generator": {
        "engine": "bippy-9e1c9544281a"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-26935",
    "datePublished": "2024-05-01T05:17:31.445Z",
    "dateReserved": "2024-02-19T14:20:24.196Z",
    "dateUpdated": "2024-11-05T09:18:29.305Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-26935\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-01T06:15:08.240\",\"lastModified\":\"2024-11-05T10:16:07.663\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nscsi: core: Fix unremoved procfs host directory regression\\n\\nCommit fc663711b944 (\\\"scsi: core: Remove the /proc/scsi/${proc_name}\\ndirectory earlier\\\") fixed a bug related to modules loading/unloading, by\\nadding a call to scsi_proc_hostdir_rm() on scsi_remove_host(). But that led\\nto a potential duplicate call to the hostdir_rm() routine, since it\u0027s also\\ncalled from scsi_host_dev_release(). That triggered a regression report,\\nwhich was then fixed by commit be03df3d4bfe (\\\"scsi: core: Fix a procfs host\\ndirectory removal regression\\\"). The fix just dropped the hostdir_rm() call\\nfrom dev_release().\\n\\nBut it happens that this proc directory is created on scsi_host_alloc(),\\nand that function \\\"pairs\\\" with scsi_host_dev_release(), while\\nscsi_remove_host() pairs with scsi_add_host(). In other words, it seems the\\nreason for removing the proc directory on dev_release() was meant to cover\\ncases in which a SCSI host structure was allocated, but the call to\\nscsi_add_host() didn\u0027t happen. And that pattern happens to exist in some\\nerror paths, for example.\\n\\nSyzkaller causes that by using USB raw gadget device, error\u0027ing on\\nusb-storage driver, at usb_stor_probe2(). By checking that path, we can see\\nthat the BadDevice label leads to a scsi_host_put() after a SCSI host\\nallocation, but there\u0027s no call to scsi_add_host() in such path. That leads\\nto messages like this in dmesg (and a leak of the SCSI host proc\\nstructure):\\n\\nusb-storage 4-1:87.51: USB Mass Storage device detected\\nproc_dir_entry \u0027scsi/usb-storage\u0027 already registered\\nWARNING: CPU: 1 PID: 3519 at fs/proc/generic.c:377 proc_register+0x347/0x4e0 fs/proc/generic.c:376\\n\\nThe proper fix seems to still call scsi_proc_hostdir_rm() on dev_release(),\\nbut guard that with the state check for SHOST_CREATED; there is even a\\ncomment in scsi_host_dev_release() detailing that: such conditional is\\nmeant for cases where the SCSI host was allocated but there was no calls to\\n{add,remove}_host(), like the usb-storage case.\\n\\nThis is what we propose here and with that, the error path of usb-storage\\ndoes not trigger the warning anymore.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: scsi: core: corrige la regresi\u00f3n del directorio del host procfs no eliminado. el commit fc663711b944 (\\\"scsi: core: elimina el directorio /proc/scsi/${proc_name} anteriormente\\\") corrigi\u00f3 un error relacionado con carga/descarga de m\u00f3dulos, agregando una llamada a scsi_proc_hostdir_rm() en scsi_remove_host(). Pero eso llev\u00f3 a una posible llamada duplicada a la rutina hostdir_rm(), ya que tambi\u00e9n se llama desde scsi_host_dev_release(). Eso desencaden\u00f3 un informe de regresi\u00f3n, que luego se solucion\u00f3 mediante el commit be03df3d4bfe (\\\"scsi: core: Fix a procfs host directorio de eliminaci\u00f3n de regresi\u00f3n\\\"). La soluci\u00f3n simplemente elimin\u00f3 la llamada hostdir_rm() desde dev_release(). Pero sucede que este directorio proc se crea en scsi_host_alloc(), y esa funci\u00f3n se \\\"empareja\\\" con scsi_host_dev_release(), mientras que scsi_remove_host() se empareja con scsi_add_host(). En otras palabras, parece que la raz\u00f3n para eliminar el directorio proc en dev_release() fue para cubrir casos en los que se asign\u00f3 una estructura de host SCSI, pero la llamada a scsi_add_host() no ocurri\u00f3. Y ese patr\u00f3n existe en algunas rutas de error, por ejemplo. Syzkaller provoca que, al utilizar un dispositivo USB sin formato, se produzca un error en el controlador de almacenamiento USB, en usb_stor_probe2(). Al verificar esa ruta, podemos ver que la etiqueta BadDevice conduce a scsi_host_put() despu\u00e9s de una asignaci\u00f3n de host SCSI, pero no hay ninguna llamada a scsi_add_host() en dicha ruta. Eso lleva a mensajes como este en dmesg (y una fuga de la estructura del proceso del host SCSI): usb-storage 4-1:87.51: Dispositivo de almacenamiento masivo USB detectado proc_dir_entry \u0027scsi/usb-storage\u0027 ya registrado ADVERTENCIA: CPU: 1 PID : 3519 en fs/proc/generic.c:377 proc_register+0x347/0x4e0 fs/proc/generic.c:376 La soluci\u00f3n adecuada parece seguir llamando a scsi_proc_hostdir_rm() en dev_release(), pero gu\u00e1rdela con la verificaci\u00f3n de estado para SHOST_CREATED ; incluso hay un comentario en scsi_host_dev_release() que detalla que: dicho condicional est\u00e1 destinado a casos en los que se asign\u00f3 el host SCSI pero no hubo llamadas a {add,remove}_host(), como el caso del almacenamiento USB. Esto es lo que proponemos aqu\u00ed y con eso, la ruta de error del almacenamiento USB ya no activa la advertencia.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0053f15d50d50c9312d8ab9c11e2e405812dfcac\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3678cf67ff7136db1dd3bf63c361650db5d92889\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5c2386ba80e779a92ec3bb64ccadbedd88f779b1\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/cea234bb214b17d004dfdccce4491e6ff57c96ee\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d4c34782b6d7b1e68d18d9549451b19433bd4c6c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e293c773c13b830cdc251f155df2254981abc320\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f23a4d6e07570826fe95023ca1aa96a011fa9f84\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f4ff08fab66eb5c0b97e1a24edac052fb40bf5d7\",\"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.