[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5b6a8e65-7a21-c333-cdb5-253034effc30@kernel.org>
Date: Fri, 4 Mar 2022 16:20:06 -0700
From: David Ahern <dsahern@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
1031265646 <1031265646@...com>,
"David S. Miller" <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Jakub Kicinski <kuba@...nel.org>
Cc: Netdev <netdev@...r.kernel.org>
Subject: Re: sendmsg bug
On 3/4/22 2:13 PM, Linus Torvalds wrote:
> The bug seems real, although mostly harmless. If ip_make_skb() returns
> NULL, it's true that udp_sendmsg() will return a misleading success
> value since 'err' will be 0 and it will return the length of the
> packet that wasn't actually ever created or sent.
>
> UDP being a lossy protocol, probably nobody has cared, since
> "successful send" doesn't mean "successful receive" anyway.
>
> I'm not sure what the right error should be for this case, and whether
> it should be fixed inside ip_make_skb() ("always return a proper
> ERR_PTR") or what.. Or whether it should just be left alone as a
> "packet dropped early" thing.
I think the right answer is to have ip_make_skb (and by extension
__ip_make_skb) always return an skb or an ERR_PTR. That means fixing up
the callers and making sure err is set properly for the various paths.
Way too late in 5.17 for such a patch, but I can take look for 5.18. The
bug has been around since 2011 (903ab86d195c).
Powered by blists - more mailing lists