Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-27 Thread David Ahern
On 1/23/21 1:42 PM, Edwin Peer wrote: > On Sat, Jan 23, 2021 at 11:14 AM David Ahern wrote: > >>> Marking truncated attributes, such that user space can determine >>> the precise attribute truncated, by means of an additional bit in >>> the nla_type was considered and rejected. The NLA_F_NESTED a

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-27 Thread David Ahern
On 1/23/21 2:03 PM, Edwin Peer wrote: > On Sat, Jan 23, 2021 at 12:42 PM Edwin Peer wrote: > >> Then, if nla_put() can detect nesting errors, there's the issue of >> what to do in the case of errors. Case in point, the IFLA_VFINFO_LIST >> scenario would now require explicit error handling in the

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-26 Thread Edwin Peer
On Mon, Jan 25, 2021 at 8:56 PM David Ahern wrote: > I'm not a fan of the skb trim idea. I think it would be better to figure > out how to stop adding to the skb when an attr length is going to exceed > 64kB. Not failing hard with an error (ip link sh needs to succeed), but > truncating the speci

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-25 Thread Jakub Kicinski
On Fri, 22 Jan 2021 20:53:18 -0800 Edwin Peer wrote: > If a nested list of attributes is too long, then the length will > exceed the 16-bit nla_len of the parent nlattr. In such cases, > determine how many whole attributes can fit and truncate the > message to this length. This properly maintains t

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-23 Thread Edwin Peer
On Sat, Jan 23, 2021 at 12:42 PM Edwin Peer wrote: > Then, if nla_put() can detect nesting errors, there's the issue of > what to do in the case of errors. Case in point, the IFLA_VFINFO_LIST > scenario would now require explicit error handling in the generator > logic, because we can't fail hard

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-23 Thread Edwin Peer
On Sat, Jan 23, 2021 at 11:14 AM David Ahern wrote: > > Marking truncated attributes, such that user space can determine > > the precise attribute truncated, by means of an additional bit in > > the nla_type was considered and rejected. The NLA_F_NESTED and > > NLA_F_NET_BYTEORDER flags are suppo

Re: [PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-23 Thread David Ahern
On 1/22/21 9:53 PM, Edwin Peer wrote: > If a nested list of attributes is too long, then the length will > exceed the 16-bit nla_len of the parent nlattr. In such cases, > determine how many whole attributes can fit and truncate the > message to this length. This properly maintains the nesting > hi

[PATCH net-next 1/4] netlink: truncate overlength attribute list in nla_nest_end()

2021-01-22 Thread Edwin Peer
If a nested list of attributes is too long, then the length will exceed the 16-bit nla_len of the parent nlattr. In such cases, determine how many whole attributes can fit and truncate the message to this length. This properly maintains the nesting hierarchy, keeping the entire message valid, while