CVE-2026-46261
Description
Linux kernel spi: wpcm-fiu driver has a NULL pointer dereference vulnerability in wpcm_fiu_probe() that can lead to a crash.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Linux kernel spi: wpcm-fiu driver has a NULL pointer dereference vulnerability in wpcm_fiu_probe() that can lead to a crash.
Vulnerability
A NULL pointer dereference vulnerability exists in the wpcm_fiu_probe() function within the Linux kernel's spi: wpcm-fiu driver. This occurs when platform_get_resource_byname() returns NULL, and the resulting NULL pointer is subsequently passed to resource_size(), leading to a crash. The fix involves moving the assignment of fiu->memory_size after the error check for devm_ioremap_resource() to prevent this dereference.
Exploitation
An attacker would need to trigger the wpcm_fiu_probe() function, likely through specific hardware configurations or module loading sequences that lead to platform_get_resource_byname() returning NULL. The vulnerability is triggered by the subsequent attempt to dereference this NULL pointer when calculating resource size.
Impact
Successful exploitation of this vulnerability would result in a crash of the Linux kernel. This denial-of-service condition would make the affected system unavailable.
Mitigation
This vulnerability has been resolved in the Linux kernel. The specific fixed version and release date are not detailed in the available references, but the patch is available via the provided kernel git link [1]. There are no workarounds mentioned, and the vulnerability is not listed as being part of the KEV catalog.
AI Insight generated on Jun 3, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
10888a0a802c46spi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index 0e3ee55165871..0e26ff1785056 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
0f93a80eb3fdspi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
9e5cb7e67fbdspi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a67432a4bea21..c006889b37ebb 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
2c538a0b3472spi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
cb9b2dc34a9espi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
2c538a0b3472spi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
cb9b2dc34a9espi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
0f93a80eb3fdspi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a9aee2a6c7dcb..c47b56f0933f1 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
888a0a802c46spi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index 0e3ee55165871..0e26ff1785056 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
9e5cb7e67fbdspi: wpcm-fiu: Fix potential NULL pointer dereference in wpcm_fiu_probe()
1 file changed · +1 −2
drivers/spi/spi-wpcm-fiu.c+1 −2 modifieddiff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index a67432a4bea21..c006889b37ebb 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -459,11 +459,11 @@ static int wpcm_fiu_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fiu->memory = devm_ioremap_resource(dev, res); - fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); if (IS_ERR(fiu->memory)) return dev_err_probe(dev, PTR_ERR(fiu->memory), "Failed to map flash memory window\n"); + fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); wpcm_fiu_hw_init(fiu); -- cgit 1.3-korg
Vulnerability mechanics
Root cause
"A NULL pointer dereference occurs when platform_get_resource_byname returns NULL and its result is passed to resource_size."
Attack vector
An attacker can trigger this vulnerability by exploiting a misconfiguration where the 'memory' resource is not properly defined for the wpcm-fiu device. This would cause platform_get_resource_byname to return NULL. Subsequently, passing this NULL pointer to resource_size within the wpcm_fiu_probe function leads to a crash.
Affected code
The vulnerability exists in the wpcm_fiu_probe() function within the file drivers/spi/spi-wpcm-fiu.c [patch_id=4686617]. Specifically, the issue arises from the order of operations involving platform_get_resource_byname() and devm_ioremap_resource().
What the fix does
The patch moves the assignment of fiu->memory_size to occur after the error check for devm_ioremap_resource [patch_id=4686617]. This ensures that resource_size is only called with a valid resource pointer, preventing the NULL pointer dereference that would have caused a crash. The change is located in drivers/spi/spi-wpcm-fiu.c.
Preconditions
- configThe device must be configured with a 'memory' resource defined in its device tree.
Generated on Jun 3, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- git.kernel.org/stable/c/0f93a80eb3fd596ddc5730d05e0e8c88e1aa2891nvd
- git.kernel.org/stable/c/2c538a0b3472e99c892c26f4940da38b7d87f632nvd
- git.kernel.org/stable/c/888a0a802c467bbe34a42167bdf9d7331333440anvd
- git.kernel.org/stable/c/9e5cb7e67fbdb8320d68d87db882a92b36f6a1d9nvd
- git.kernel.org/stable/c/cb9b2dc34a9eef0855edb00ae9c9b7f72394281bnvd
News mentions
2- Google Android and Linux Kernel: 50 Vulnerabilities Disclosed in Two BatchesVypr Intelligence · Jun 3, 2026
- Linux Kernel: 25 Vulnerabilities Disclosed in Single Batch on June 3, 2026Vypr Intelligence · Jun 3, 2026