# CVE-2021-47476: comedi: ni\_usb6501: fix NULL-deref in command paths

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.6
- **CVSS:** 4.6 (v3.1, CNA) `CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Physical; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.55% (percentile 40, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-05-22T08:19:30.201Z
- **Modified:** 2026-06-17T04:17:33.640Z

## Who should check

- Anyone running Linux \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 58478143771b20ab219937b1c30a706590a59224; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< aa39738423503825625853b643b9e99d11c23816; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< df7b1238f3b599a0b9284249772cdfd1ea83a632; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< bc51111bf6e8e7b6cc94b133e4c291273a16acd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< b0156b7c9649d8f55a2ce3d3258509f1b2a181c3; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< ef143dc0c3defe56730ecd3a9de7b3e1d7e557c1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 4a9d43cb5d5f39fa39fc1da438517004cc95f7ea; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< d6a727a681a39ae4f73081a9bedb45d14f95bdd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 907767da8f3a925b060c740e0b5c92ea7dbec440
- Anyone running Linux 3.18

## Description

In the Linux kernel, the following vulnerability has been resolved:

comedi: ni\_usb6501: fix NULL-deref in command paths

The driver uses endpoint-sized USB transfer buffers but had no sanity
checks on the sizes. This can lead to zero-size-pointer dereferences or
overflowed transfer buffers in ni6501\_port\_command() and
ni6501\_counter\_command() if a (malicious) device has smaller max-packet
sizes than expected (or when doing descriptor fuzz testing).

Add the missing sanity checks to probe().

## Affected and fixed versions

- Linux: \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 58478143771b20ab219937b1c30a706590a59224; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< aa39738423503825625853b643b9e99d11c23816; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< df7b1238f3b599a0b9284249772cdfd1ea83a632; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< bc51111bf6e8e7b6cc94b133e4c291273a16acd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< b0156b7c9649d8f55a2ce3d3258509f1b2a181c3; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< ef143dc0c3defe56730ecd3a9de7b3e1d7e557c1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 4a9d43cb5d5f39fa39fc1da438517004cc95f7ea; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< d6a727a681a39ae4f73081a9bedb45d14f95bdd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 907767da8f3a925b060c740e0b5c92ea7dbec440 (cvelist)
- Linux: 3.18 (cvelist)

## Mitigation

- Upgrade Linux to 907767da8f3a925b060c740e0b5c92ea7dbec440 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47476. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47476.md
Affected: Linux >= a03bb00e50ab4c07107da58a52a0bff7943f360c, < 58478143771b20ab219937b1c30a706590a59224; >= a03bb00e50ab4c07107da58a52a0bff7943f360c, < aa39738423503825625853b643b9e99d11c23816; >= a03bb00e50ab4c07107da58a52a0bff7943f360c, < df7b1238f3b599a0b9284249772cdfd1ea83a632; >= a03bb00e50ab4c07107da58…
Fixed in: Linux 58478143771b20ab219937b1c30a706590a59224, Linux 4a9d43cb5d5f39fa39fc1da438517004cc95f7ea, Linux 907767da8f3a925b060c740e0b5c92ea7dbec440

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47476 being exploited?

There is no confirmed exploitation: CVE-2021-47476 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.55% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47476?

Medium: CVSS 4.6 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47476?

Linux \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 58478143771b20ab219937b1c30a706590a59224; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< aa39738423503825625853b643b9e99d11c23816; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< df7b1238f3b599a0b9284249772cdfd1ea83a632; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< bc51111bf6e8e7b6cc94b133e4c291273a16acd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< b0156b7c9649d8f55a2ce3d3258509f1b2a181c3; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< ef143dc0c3defe56730ecd3a9de7b3e1d7e557c1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 4a9d43cb5d5f39fa39fc1da438517004cc95f7ea; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< d6a727a681a39ae4f73081a9bedb45d14f95bdd1; \>= a03bb00e50ab4c07107da58a52a0bff7943f360c, \< 907767da8f3a925b060c740e0b5c92ea7dbec440; Linux 3.18.

### Is there a fix for CVE-2021-47476?

Yes. Fixed in Linux 58478143771b20ab219937b1c30a706590a59224, Linux 4a9d43cb5d5f39fa39fc1da438517004cc95f7ea, Linux 907767da8f3a925b060c740e0b5c92ea7dbec440. Upgrade Linux to 907767da8f3a925b060c740e0b5c92ea7dbec440 or later.

### How do I check if I'm affected by CVE-2021-47476?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/58478143771b20ab219937b1c30a706590a59224>
- patch: <https://git.kernel.org/stable/c/aa39738423503825625853b643b9e99d11c23816>
- patch: <https://git.kernel.org/stable/c/df7b1238f3b599a0b9284249772cdfd1ea83a632>
- patch: <https://git.kernel.org/stable/c/bc51111bf6e8e7b6cc94b133e4c291273a16acd1>
- patch: <https://git.kernel.org/stable/c/b0156b7c9649d8f55a2ce3d3258509f1b2a181c3>
- patch: <https://git.kernel.org/stable/c/ef143dc0c3defe56730ecd3a9de7b3e1d7e557c1>
- patch: <https://git.kernel.org/stable/c/4a9d43cb5d5f39fa39fc1da438517004cc95f7ea>
- patch: <https://git.kernel.org/stable/c/d6a727a681a39ae4f73081a9bedb45d14f95bdd1>
- patch: <https://git.kernel.org/stable/c/907767da8f3a925b060c740e0b5c92ea7dbec440>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47476>

HTML: <https://flawdb.com/CVE-2021-47476> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47476>
