Re: [PATCH v3] net: netlink: af_netlink: Prevent empty skb by adding a check on len.

From: Jakub Kicinski
Date: Mon Nov 29 2021 - 14:29:44 EST


On Sat, 27 Nov 2021 09:28:41 -0800 Stephen Hemminger wrote:
> Are you sure no application is doing zero length send for some
> reason?
> Maybe doing the check in netlink_deliver_tap would be less likely
> to cause visible change in behavior to applications.

That's still a uAPI change, and leads to less obvious code.

I'd prefer to stick to the current patch which at least signals very
clearly that the functionality has been broken by returning an error
to the caller, and we can rethink if anyone actually complains.

Maybe adding a pr_warn_once() to the case would save the hypothetical
user/developer some time, too?