In the Linux kernel, the following vulnerability has been resolved:
scsi: ufs: mcq: Add NULL check in ufshcdmcqabort()
A race can occur between the MCQ completion path and the abort handler: once a request completes, _blkmqfreerequest() sets rq->mqhctx to NULL, meaning the subsequent ufshcdmcqreqtohwq() call in ufshcdmcq_abort() can return a NULL pointer. If this NULL pointer is dereferenced, the kernel will crash.
Add a NULL check for the returned hwq pointer. If hwq is NULL, log an error and return FAILED, preventing a potential NULL-pointer dereference. As suggested by Bart, the ufshcdcmdinflight() check is removed.
This is similar to the fix in commit 74736103fb41 ("scsi: ufs: core: Fix ufshcdabortone racing issue").
This is found by our static analysis tool KNighter.
[
{
"id": "CVE-2025-37828-5e1e5021",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52917314539432514543551495812386112312",
"252867231482471798464453983428670396120",
"310892467737572223574943905143014024592",
"74346821640625466249006131627301065022",
"194263443683805189027564711363178388960",
"190324579061070589182453613241665954422",
"165431515240329810282249176655887961174",
"55740106221764876146589921339693630179",
"147483861748942436620805941478135191751",
"183504620441550780164706681524206578045",
"336011019467125675990704923147384014776",
"330180386925785116574672838534433296141",
"36500812549381791891797550369040859751"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d6979fabe812a168d5053e5a41d5a2e9b8afd7bf",
"target": {
"file": "drivers/ufs/core/ufs-mcq.c"
}
},
{
"id": "CVE-2025-37828-e6a69868",
"signature_version": "v1",
"digest": {
"length": 1040.0,
"function_hash": "1984607463207664305946544976049652958"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d6979fabe812a168d5053e5a41d5a2e9b8afd7bf",
"target": {
"file": "drivers/ufs/core/ufs-mcq.c",
"function": "ufshcd_mcq_abort"
}
}
]