Re: [PATCH net v2 1/3] net: replace calls to sock->ops->connect() with kernel_connect()

From
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date
2023-09-18 18:01:41
Reply to
Jordan Rife, 2023-09-18
On Mon, Sep 18, 2023 at 1:56 PM Jordan Rife [off-list ref] wrote:
quoted
Please include a Fixes tag in all patches targeting next.
Would this just be a reference to the commit that introduced this bug?
That's right. So that stable tree maintainers know whether to backport or not.

Please also cc: stable@vger.kernel.org to net patches:
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#stable-tree
Should this patch series be targeting net or net-next considering this
is a long standing bug, not something that was introduced recently.
It sounds like BPF hooks break existing users of kernel_connect. So I
think you directed it correctly to net.
quoted
For subsequent iteration, no need for a manual follow-up email to CC the subsystem reviews. Just add --cc to git send-email?
Ack.

-Jordan

On Mon, Sep 18, 2023 at 6:07 AM Willem de Bruijn
[off-list ref] wrote:
quoted
On Sun, Sep 17, 2023 at 10:50 PM Jordan Rife [off-list ref] wrote:
quoted
commit 0bdf399342c5 ("net: Avoid address overwrite in kernel_connect")
ensured that kernel_connect() will not overwrite the address parameter
in cases where BPF connect hooks perform an address rewrite. This change
replaces all direct calls to sock->ops->connect() with kernel_connect()
to make these call safe.

This patch also introduces a sanity check to kernel_connect() to ensure
that the addr_length does not exceed the size of sockaddr_storage before
performing the address copy.

Link: https://lore.kernel.org/netdev/20230912013332.2048422-1-jrife@google.com/ (local)

Signed-off-by: Jordan Rife <redacted>
This looks great to me. Thanks for revising and splitting up.

Please include a Fixes tag in all patches targeting next.

For subsequent iteration, no need for a manual follow-up email to CC
the subsystem reviews. Just add --cc to git send-email?
Thread (14 messages) 14 messages, 2 authors, last reply 2023-09-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help