block: don't overwrite bip_vcnt in bio_integrity_copy_user()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
block: don't overwrite bip_vcnt in bio_integrity_copy_user()
bio_integrity_add_page() already sets bip_vcnt to 1 for the bounce segment. Overwriting it with nr_vecs breaks bip_vcnt <= bip_max_vcnt on WRITE (bip_max_vcnt is 1), so the gap-merge checks in block/blk.h read past the bip_vec[] flex array. On READ the read is in bounds but lands on a saved user bvec instead of the bounce.
The line was added for split propagation, but bio_integrity_clone() doesn't copy bip_vcnt and BIP_CLONE_FLAGS excludes BIP_COPY_USER.
From the CVE record · Linux
In the Linux kernel, bio_integrity_copy_user() can set an incorrect segment count for a bounce segment. On WRITE, this can cause block-layer gap-merge checks to read past the bip_vec[] array; on READ, the check reads a saved user vector instead of the bounce segment. The input does not specify attacker access or authentication requirements.
Engineers running Linux kernels with the affected block integrity code should check their kernel versions against the vendor advisory; affected versions were not provided.