In the Linux kernel, the following vulnerability has been resolved:
scsi: core: Move scsihostbusy() out of host lock for waking up EH handler
Inside scsiehwakeup(), scsihostbusy() is called & checked with host lock every time for deciding if error handler kthread needs to be waken up.
This can be too heavy in case of recovery, such as:
N hardware queues
queue depth is M for each hardware queue
each scsihostbusy() iterates over (N * M) tag/requests
If recovery is triggered in case that all requests are in-flight, each scsiehwakeup() is strictly serialized, when scsiehwakeup() is called for the last in-flight request, scsihostbusy() has been run for (N * M - 1) times, and request has been iterated for (N*M - 1) * (N * M) times.
If both N and M are big enough, hard lockup can be triggered on acquiring host lock, and it is observed on mpi3mr(128 hw queues, queue depth 8169).
Fix the issue by calling scsihostbusy() outside the host lock. We don't need the host lock for getting busy count because host the lock never covers that.
[mkp: Drop unnecessary 'busy' variables pointed out by Bart]
{ "vanir_signatures": [ { "digest": { "length": 366.0, "function_hash": "170347816820644534324364793599439053161" }, "target": { "function": "scsi_dec_host_busy", "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-0088a7e2" }, { "digest": { "length": 366.0, "function_hash": "170347816820644534324364793599439053161" }, "target": { "function": "scsi_dec_host_busy", "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-115d97f9" }, { "digest": { "length": 283.0, "function_hash": "312373647895839665793798011646041495327" }, "target": { "function": "scsi_eh_inc_host_failed", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-2e0a5c37" }, { "digest": { "length": 293.0, "function_hash": "107052644789976096791152855879477497931" }, "target": { "function": "scsi_schedule_eh", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-2ed77b7b" }, { "digest": { "length": 283.0, "function_hash": "312373647895839665793798011646041495327" }, "target": { "function": "scsi_eh_inc_host_failed", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-3d326265" }, { "digest": { "length": 262.0, "function_hash": "241562684099421545415107879304535990907" }, "target": { "function": "scsi_eh_wakeup", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-457e6e87" }, { "digest": { "length": 293.0, "function_hash": "107052644789976096791152855879477497931" }, "target": { "function": "scsi_schedule_eh", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-48ad8ddd" }, { "digest": { "line_hashes": [ "180441981332434883807250649157141701607", "285094600362839651208940226914726990619", "144002240002620269544106524884602675548", "17790458684413210667860310859432659588", "244228258431449208101729485397747513685", "164430281037486245609126114601357734970", "209460138280667106131209032579485830922", "232110171423054999813100755299854216997", "189508989416449169455338016892589380321", "113159945551267140847264435376642997153", "20490531051732327908566608801969765214", "155418819622984856479055879172724435796", "36175545877242539586299924544128983435", "292351526925554194363258017321337422854", "238873675638042917843523494215034555553" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-49445248" }, { "digest": { "length": 366.0, "function_hash": "170347816820644534324364793599439053161" }, "target": { "function": "scsi_dec_host_busy", "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-50749051" }, { "digest": { "length": 293.0, "function_hash": "107052644789976096791152855879477497931" }, "target": { "function": "scsi_schedule_eh", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-542843ed" }, { "digest": { "line_hashes": [ "127143650267382904723738345194924065791", "5149812111605596011984076073699054103", "217335782815737019818536186880586591352", "284827520744176810782710474027162228355" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-59f26a0c" }, { "digest": { "line_hashes": [ "264197838022245000355472640220657566896", "197009909555892557316935677775914057631", "237325671176804353677066613494115218175", "146691154682189174875182668253397206110" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_priv.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-631f860f" }, { "digest": { "line_hashes": [ "269855243562043685111452774089059728872", "197009909555892557316935677775914057631", "237325671176804353677066613494115218175", "146691154682189174875182668253397206110" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_priv.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-6519605d" }, { "digest": { "line_hashes": [ "264197838022245000355472640220657566896", "197009909555892557316935677775914057631", "237325671176804353677066613494115218175", "146691154682189174875182668253397206110" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_priv.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-66321cc7" }, { "digest": { "length": 366.0, "function_hash": "170347816820644534324364793599439053161" }, "target": { "function": "scsi_dec_host_busy", "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-6903130a" }, { "digest": { "length": 293.0, "function_hash": "107052644789976096791152855879477497931" }, "target": { "function": "scsi_schedule_eh", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-6e1f0b98" }, { "digest": { "line_hashes": [ "127143650267382904723738345194924065791", "5149812111605596011984076073699054103", "217335782815737019818536186880586591352", "284827520744176810782710474027162228355" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-78793d0e" }, { "digest": { "line_hashes": [ "121214666017154813267838029607174995042", "270510907231602971660302542662600735475", "144002240002620269544106524884602675548", "17790458684413210667860310859432659588", "244228258431449208101729485397747513685", "164430281037486245609126114601357734970", "209460138280667106131209032579485830922", "232110171423054999813100755299854216997", "189508989416449169455338016892589380321", "113159945551267140847264435376642997153", "20490531051732327908566608801969765214", "155418819622984856479055879172724435796", "36175545877242539586299924544128983435", "292351526925554194363258017321337422854", "238873675638042917843523494215034555553" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-97b26094" }, { "digest": { "line_hashes": [ "269855243562043685111452774089059728872", "197009909555892557316935677775914057631", "237325671176804353677066613494115218175", "146691154682189174875182668253397206110" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_priv.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-9a19ab8a" }, { "digest": { "line_hashes": [ "121214666017154813267838029607174995042", "270510907231602971660302542662600735475", "144002240002620269544106524884602675548", "17790458684413210667860310859432659588", "244228258431449208101729485397747513685", "164430281037486245609126114601357734970", "209460138280667106131209032579485830922", "232110171423054999813100755299854216997", "189508989416449169455338016892589380321", "113159945551267140847264435376642997153", "20490531051732327908566608801969765214", "155418819622984856479055879172724435796", "36175545877242539586299924544128983435", "292351526925554194363258017321337422854", "238873675638042917843523494215034555553" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-bd49c4c7" }, { "digest": { "line_hashes": [ "127143650267382904723738345194924065791", "5149812111605596011984076073699054103", "217335782815737019818536186880586591352", "284827520744176810782710474027162228355" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-c2637bd5" }, { "digest": { "length": 262.0, "function_hash": "241562684099421545415107879304535990907" }, "target": { "function": "scsi_eh_wakeup", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-c98358c7" }, { "digest": { "length": 293.0, "function_hash": "107052644789976096791152855879477497931" }, "target": { "function": "scsi_schedule_eh", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-ce0350e9" }, { "digest": { "length": 283.0, "function_hash": "312373647895839665793798011646041495327" }, "target": { "function": "scsi_eh_inc_host_failed", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-ced1ec12" }, { "digest": { "line_hashes": [ "180441981332434883807250649157141701607", "285094600362839651208940226914726990619", "144002240002620269544106524884602675548", "17790458684413210667860310859432659588", "244228258431449208101729485397747513685", "164430281037486245609126114601357734970", "209460138280667106131209032579485830922", "232110171423054999813100755299854216997", "189508989416449169455338016892589380321", "113159945551267140847264435376642997153", "20490531051732327908566608801969765214", "155418819622984856479055879172724435796", "36175545877242539586299924544128983435", "292351526925554194363258017321337422854", "238873675638042917843523494215034555553" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-cf34476e" }, { "digest": { "line_hashes": [ "121214666017154813267838029607174995042", "270510907231602971660302542662600735475", "144002240002620269544106524884602675548", "17790458684413210667860310859432659588", "244228258431449208101729485397747513685", "164430281037486245609126114601357734970", "209460138280667106131209032579485830922", "232110171423054999813100755299854216997", "189508989416449169455338016892589380321", "113159945551267140847264435376642997153", "20490531051732327908566608801969765214", "155418819622984856479055879172724435796", "36175545877242539586299924544128983435", "292351526925554194363258017321337422854", "238873675638042917843523494215034555553" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-d11ce3fc" }, { "digest": { "length": 283.0, "function_hash": "312373647895839665793798011646041495327" }, "target": { "function": "scsi_eh_inc_host_failed", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-d34a9792" }, { "digest": { "line_hashes": [ "127143650267382904723738345194924065791", "5149812111605596011984076073699054103", "217335782815737019818536186880586591352", "284827520744176810782710474027162228355" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-d5bff742" }, { "digest": { "length": 262.0, "function_hash": "241562684099421545415107879304535990907" }, "target": { "function": "scsi_eh_wakeup", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5944853f7a961fedc1227dc8f60393f8936d37c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-daeb760b" }, { "digest": { "length": 262.0, "function_hash": "241562684099421545415107879304535990907" }, "target": { "function": "scsi_eh_wakeup", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-dda2c33f" }, { "digest": { "length": 283.0, "function_hash": "312373647895839665793798011646041495327" }, "target": { "function": "scsi_eh_inc_host_failed", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-ddb153b3" }, { "digest": { "length": 262.0, "function_hash": "241562684099421545415107879304535990907" }, "target": { "function": "scsi_eh_wakeup", "file": "drivers/scsi/scsi_error.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d37c1c81419fdef66ebd0747cf76fb8b7d979059", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-e480521b" }, { "digest": { "line_hashes": [ "269855243562043685111452774089059728872", "197009909555892557316935677775914057631", "237325671176804353677066613494115218175", "146691154682189174875182668253397206110" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_priv.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4373534a9850627a2695317944898eb1283a2db0", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-f3e2f3dc" }, { "digest": { "line_hashes": [ "127143650267382904723738345194924065791", "5149812111605596011984076073699054103", "217335782815737019818536186880586591352", "284827520744176810782710474027162228355" ], "threshold": 0.9 }, "target": { "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65ead8468c21c2676d4d06f50b46beffdea69df1", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-fc3f7a2a" }, { "digest": { "length": 366.0, "function_hash": "170347816820644534324364793599439053161" }, "target": { "function": "scsi_dec_host_busy", "file": "drivers/scsi/scsi_lib.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db6338f45971b4285ea368432a84033690eaf53c", "deprecated": false, "signature_version": "v1", "id": "CVE-2024-26627-ffb6b069" } ] }