netlink: reset skb headers before unicast and multicast filtering
Impact
In the Linux kernel, the following vulnerability has been resolved:
Source excerpt · LinuxAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Linux · Linux
Other versions: unaffected
| Version / range | Source status |
|---|---|
| b1153f29ee07dc1a788964409255a4b4fae50b98 to before 06791594274f87c29f1a9f1961d700272716a49d | affected |
| b1153f29ee07dc1a788964409255a4b4fae50b98 to before 06935da5de83aa8b98841563894857e7d2f80e47 | affected |
| b1153f29ee07dc1a788964409255a4b4fae50b98 to before 8bf659bd54e1f00e34cf5244b1d289c506fa47c0 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 2.6.26 | affected |
| 0 to before 2.6.26 | unaffected |
| 6.18.59 through 6.18.* (inclusive) | unaffected |
| 7.2.13 through 7.2.* (inclusive) | unaffected |
| 7.3 through * (inclusive) | unaffected |
Original source description
In the Linux kernel, the following vulnerability has been resolved:
netlink: reset skb headers before unicast and multicast filtering
Socket filters can use SKF_NET_OFF and SKF_LL_OFF to read relative to an skb's network and MAC headers. Netlink producers may reserve headroom without resetting those headers, allowing a receiving socket's filter to read data before the initialized message.
For example, IWPM HELLO replies are allocated with dev_alloc_skb(), which reserves NET_SKB_PAD bytes. An unprivileged NETLINK_RDMA user can attach a classic socket filter and disclose this headroom through the length of the delivered reply. The resets in netlink_dump() do not help because IWPM sends a separately allocated skb through netlink_unicast().
Reset both headers before running the receiver's filter in unicast and broadcast delivery, as is already done for dump skbs. This also covers other netlink producers that reserve headroom without changing their allocation or message-building code.