net: af_key: zero aligned sockaddr tail in PF_KEY exports
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < edd446ee7cd3d02cac246168063d5b3e9ea68460| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: af_key: zero aligned sockaddr tail in PF_KEY exports
PF_KEY export paths use `pfkey_sockaddr_size()` when reserving sockaddr payload space, so IPv6 addresses occupy 32 bytes on the wire. However, `pfkey_sockaddr_fill()` initializes only the first 28 bytes of `struct sockaddr_in6`, leaving the final 4 aligned bytes uninitialized.
Not every PF_KEY message is affected. The state and policy dump builders already zero the whole message buffer before filling the sockaddr payloads. Keep the fix to the export paths that still append aligned sockaddr payloads with plain `skb_put()`:
- `SADB_ACQUIRE` - `SADB_X_NAT_T_NEW_MAPPING` - `SADB_X_MIGRATE`
Fix those paths by clearing only the aligned sockaddr tail after `pfkey_sockaddr_fill()`.
From the CVE record · Linux
The Linux kernel's PF_KEY export paths can leave four aligned bytes uninitialized when exporting IPv6 sockaddr payloads in SADB_ACQUIRE, SADB_X_NAT_T_NEW_MAPPING, and SADB_X_MIGRATE messages. Those messages may expose the uninitialized bytes; the input does not specify access requirements or user interaction.
Engineers running the Linux kernel should check their installations; affected versions are not specified.