HIGH Introduced in 5.3
ubifs Signature OOB
CVE-2026-89720
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
KernelScan AI3.4LOW
01Description
In the Linux kernel, the following vulnerability has been resolved: ubifs: fix out-of-bounds read in signature length check ubifs_sb_verify_signature() bounds the on-disk ubifs_sig_node->len field before handing the signature payload to verify_pkcs7_signature(), but the check has the wrong sign: if (le32_to_cpu(signode->len) > snod->len + sizeof(struct ubifs_sig_node)) The signature bytes start sizeof(struct ubifs_sig_node) (UBIFS_SIG_NODE_SZ, 64 bytes) into the node, so the payload is at most snod->len - sizeof(struct ubifs_sig_node) bytes long. Adding the header size instead of subtracting it accepts a declared length up to 2 * UBIFS_SIG_NODE_SZ larger than the node actually holds -- past the end of c->sbuf, which is vmalloc(c->leb_size). verify_pkcs7_signature() -> pkcs7_parse_message() -> asn1_ber_decoder() is then handed that inflated length and reads beyond the allocation while walking the DER headers. The node length comes straight from the mounted image, so a crafted signed UBIFS image reaches this via ubifs_read_superblock() before the signature is cryptographically checked. snod->len is guaranteed to be >= UBIFS_SIG_NODE_SZ by the node scanner (c->ranges[UBIFS_SIG_NODE].min_len == UBIFS_SIG_NODE_SZ), so the corrected subtraction cannot underflow. Legitimately signed images are unaffected: a correct superblock never declares a signature longer than the node it is embedded in.
02KernelScan AI Analysis
Risk summary
A crafted UBIFS filesystem image with an inflated signature length field can cause the kernel to read up to 128 bytes past the end of a vmalloc buffer during mount-time signature verification. The bug requires CAP_SYS_ADMIN to trigger (mounting a non-userns filesystem), limiting exposure to scenarios where an attacker can either gain root access or tamper with the device's NAND flash. Impact is limited to a small bounded information leak and potential kernel oops.
Vulnerability analysis
When mounting a signed UBIFS image, the signature length validation incorrectly adds the signature node header size to the node length instead of subtracting it, accepting a declared signature payload up to 128 bytes longer than the node actually contains. The PKCS#7 signature parser is then handed this inflated length and reads beyond the end of the allocated buffer while parsing DER/ASN.1 headers. The fix corrects the arithmetic so the header size is subtracted, properly bounding the signature payload to what fits within the node. The vulnerability is reachable only by mounting a crafted UBIFS image, which requires CAP_SYS_ADMIN in the init namespace — UBIFS is not mountable from user namespaces. The overread occurs before any cryptographic verification, so a valid signature is not needed to trigger it.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.3 | 5.10.270 | ab7405bd8633 |
| 5.15 | 5.3 | 5.15.221 | 11abc34698cb |
| 6.6 | 5.3 | 6.6.157 | 37a9d25a563f |
| 6.12 | 5.3 | 6.12.109 | f76b79d6e42a |
| 6.18 | 5.3 | 6.18.50 | a1dc246f98bb |
| mainline | 5.3 | 7.3-rc1 | 95d27c1708bb |
| 7.2 | 5.3 | 7.2.4 | 83e1aa9f5f90 |
| 6.1 | 5.3 | 6.1.188 | 8cc3da72cf57 |
| cip/6.12 | 5.3 | 6.12.111-cip32 | f76b79d6e42a |