Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netlink: Refine calculation of maximum-length attributes.
Until now the Netlink code has considered an attribute to exceed the maximum length if the *padded* size of the attribute exceeds 65535 bytes. For example, an attribute with a 65529-byte payload, together with 4-byte header and 3 bytes of padding, takes up 65536 bytes and therefore the existing code rejected it. However, the restriction on Netlink attribute sizes is to ensure that the length fits in the 16-bit nla_len field. This field includes the 4-byte header but not the padding, so a 65529-byte payload is acceptable because, with the header but not the padding, it comes to only 65533 bytes. Thus, this commit relaxes the restriction on Netlink attribute sizes by omitting padding from size checks. It also changes one piece of code that inlined a size check to use the central function nl_attr_oversized(). This change should fix an assertion failure when OVS userspace passes a maximum-size (65529+ byte) packet back to the kernel. Reported-by: Shuping Cui <[email protected]> Reported-by: Jiri Benc <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Jesse Gross <[email protected]>
- Loading branch information