xfrm: validate new SA's prefixlen using SA family when sel.family is unset
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 7d9868180bd1e4cf37e7c5067362658971162366| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xfrm: validate new SA's prefixlen using SA family when sel.family is unset
This expands the validation introduced in commit 07bf7908950a ("xfrm: Validate address prefix lengths in the xfrm selector.")
syzbot created an SA with usersa.sel.family = AF_UNSPEC usersa.sel.prefixlen_s = 128 usersa.family = AF_INET
Because of the AF_UNSPEC selector, verify_newsa_info doesn't put limits on prefixlen_{s,d}. But then copy_from_user_state sets x->sel.family to usersa.family (AF_INET). Do the same conversion in verify_newsa_info before validating prefixlen_{s,d}, since that's how prefixlen is going to be used later on.
From the CVE record · Linux
The Linux kernel's xfrm validation can accept an invalid address prefix length when a new security association has an unset selector family but specifies an IPv4 family. The prefix length is then used as IPv4 after the selector family is changed to IPv4. The input does not establish an attacker impact or whether network access, authentication, or user interaction is required.
Teams running Linux kernels with the affected xfrm validation behavior should check their versions against the vendor advisory; affected versions were not provided.