android_kernel_oneplus_msm8998/net/rds
Sowmini Varadhan f69275de10 rds; Reset rs->rs_bound_addr in rds_add_bound() failure path
[ Upstream commit 7ae0c649c47f1c5d2db8cee6dd75855970af1669 ]

If the rds_sock is not added to the bind_hash_table, we must
reset rs_bound_addr so that rds_remove_bound will not trip on
this rds_sock.

rds_add_bound() does a rds_sock_put() in this failure path, so
failing to reset rs_bound_addr will result in a socket refcount
bug, and will trigger a WARN_ON with the stack shown below when
the application subsequently tries to close the PF_RDS socket.

     WARNING: CPU: 20 PID: 19499 at net/rds/af_rds.c:496 \
		rds_sock_destruct+0x15/0x30 [rds]
       :
     __sk_destruct+0x21/0x190
     rds_remove_bound.part.13+0xb6/0x140 [rds]
     rds_release+0x71/0x120 [rds]
     sock_release+0x1a/0x70
     sock_close+0xe/0x20
     __fput+0xd5/0x210
     task_work_run+0x82/0xa0
     do_exit+0x2ce/0xb30
     ? syscall_trace_enter+0x1cc/0x2b0
     do_group_exit+0x39/0xa0
     SyS_exit_group+0x10/0x10
     do_syscall_64+0x61/0x1a0

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-13 19:50:13 +02:00
..
af_rds.c
bind.c rds; Reset rs->rs_bound_addr in rds_add_bound() failure path 2018-04-13 19:50:13 +02:00
cong.c RDS: Fix the atomicity for congestion map update 2017-05-02 21:19:49 -07:00
connection.c
ib.c
ib.h
ib_cm.c rds: ib: add error handle 2017-10-08 10:14:19 +02:00
ib_rdma.c
ib_recv.c
ib_ring.c
ib_send.c RDS: RDMA: Fix the composite message user notification 2017-10-08 10:14:16 +02:00
ib_stats.c
ib_sysctl.c
info.c
info.h
iw.c
iw.h
iw_cm.c
iw_rdma.c
iw_recv.c
iw_ring.c
iw_send.c
iw_stats.c
iw_sysctl.c
Kconfig
loop.c
loop.h
Makefile
message.c
page.c
rdma.c RDS: null pointer dereference in rds_atomic_free_op 2018-01-17 09:35:29 +01:00
rdma_transport.c
rdma_transport.h
rds.h RDS: RDMA: Fix the composite message user notification 2017-10-08 10:14:16 +02:00
recv.c
send.c RDS: RDMA: return appropriate error on rdma map failures 2017-11-30 08:37:25 +00:00
stats.c
sysctl.c
tcp.c
tcp.h
tcp_connect.c
tcp_listen.c rds: tcp: use sock_create_lite() to create the accept socket 2017-07-21 07:44:55 +02:00
tcp_recv.c
tcp_send.c
tcp_stats.c
threads.c
transport.c