WSL2-Linux-Kernel/net/rds
Jia-Ju Bai c7ba50fe23 net: rds: Fix possible null-pointer dereferences in rds_rdma_cm_event_handler_cmn()
In rds_rdma_cm_event_handler_cmn(), there are some if statements to
check whether conn is NULL, such as on lines 65, 96 and 112.
But conn is not checked before being used on line 108:
    trans->cm_connect_complete(conn, event);
and on lines 140-143:
    rdsdebug("DISCONNECT event - dropping connection "
            "%pI6c->%pI6c\n", &conn->c_laddr,
            &conn->c_faddr);
    rds_conn_drop(conn);

Thus, possible null-pointer dereferences may occur.

To fix these bugs, conn is checked before being used.

These bugs are found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-27 13:58:12 -07:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
af_rds.c net/rds: Check address length before reading address family 2019-04-12 10:25:03 -07:00
bind.c net/rds: Check address length before reading address family 2019-04-12 10:25:03 -07:00
cong.c
connection.c rds: Return proper "tos" value to user-space 2019-07-09 21:45:42 -07:00
ib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-07 11:00:14 -07:00
ib.h net/rds: Keep track of and wait for FRWR segments in use upon shutdown 2019-07-17 12:06:52 -07:00
ib_cm.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-07-19 10:06:06 -07:00
ib_fmr.c net: rds: exchange of 8K and 1M pool 2019-04-24 12:07:08 -07:00
ib_frmr.c net/rds: Keep track of and wait for FRWR segments in use upon shutdown 2019-07-17 12:06:52 -07:00
ib_mr.h net/rds: Wait for the FRMR_IS_FREE (or FRMR_IS_STALE) transition after posting IB_WR_LOCAL_INV 2019-07-17 12:06:52 -07:00
ib_rdma.c net/rds: Fix NULL/ERR_PTR inconsistency 2019-07-17 12:06:52 -07:00
ib_recv.c net: rds: fix memory leak when unload rds_rdma 2019-06-05 17:08:14 -07:00
ib_ring.c
ib_send.c rds: fix reordering with composite message notification 2019-07-09 21:45:41 -07:00
ib_stats.c
ib_sysctl.c
info.c mm/gup: change GUP fast to use flags rather than a write 'bool' 2019-05-14 09:47:46 -07:00
info.h
loop.c
loop.h
message.c
page.c
rdma.c rds: fix reordering with composite message notification 2019-07-09 21:45:41 -07:00
rdma_transport.c net: rds: Fix possible null-pointer dereferences in rds_rdma_cm_event_handler_cmn() 2019-07-27 13:58:12 -07:00
rdma_transport.h rds: rdma: add consumer reject 2019-02-04 14:59:11 -08:00
rds.h rds: fix reordering with composite message notification 2019-07-09 21:45:41 -07:00
rds_single_path.h
recv.c rds: add type of service(tos) infrastructure 2019-02-04 14:59:12 -08:00
send.c rds: fix reordering with composite message notification 2019-07-09 21:45:41 -07:00
stats.c
sysctl.c
tcp.c net: rds: fix spelling mistake "syctl" -> "sysctl" 2019-05-05 10:19:43 -07:00
tcp.h
tcp_connect.c
tcp_listen.c rds: add type of service(tos) infrastructure 2019-02-04 14:59:12 -08:00
tcp_recv.c
tcp_send.c
tcp_stats.c
threads.c
transport.c