android_kernel_xiaomi_sm8350/net/rds
Jordan Rife 907a380eb3 net: prevent address rewrite in kernel_bind()
commit c889a99a21bf124c3db08d09df919f0eccc5ea4c upstream.

Similar to the change in commit 0bdf399342c5("net: Avoid address
overwrite in kernel_connect"), BPF hooks run on bind may rewrite the
address passed to kernel_bind(). This change

1) Makes a copy of the bind address in kernel_bind() to insulate
   callers.
2) Replaces direct calls to sock->ops->bind() in net with kernel_bind()

Link: https://lore.kernel.org/netdev/20230912013332.2048422-1-jrife@google.com/
Fixes: 4fbac77d2d ("bpf: Hooks for sys_bind")
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jordan Rife <jrife@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 11:53:18 +02:00
..
af_rds.c
bind.c
cong.c
connection.c
ib_cm.c
ib_fmr.c
ib_frmr.c
ib_mr.h
ib_rdma.c
ib_recv.c
ib_ring.c
ib_send.c
ib_stats.c
ib_sysctl.c
ib.c
ib.h
info.c
info.h
Kconfig
loop.c
loop.h
Makefile
message.c
page.c
rdma_transport.c
rdma_transport.h
rdma.c
rds_single_path.h
rds.h
recv.c
send.c
stats.c
sysctl.c
tcp_connect.c net: prevent address rewrite in kernel_bind() 2023-10-25 11:53:18 +02:00
tcp_listen.c net: prevent address rewrite in kernel_bind() 2023-10-25 11:53:18 +02:00
tcp_recv.c
tcp_send.c
tcp_stats.c
tcp.c
tcp.h
threads.c
transport.c