kernel_optimize_test/net/rds
Lv Yunlong 4cfae7b238 net/rds: Fix a use after free in rds_message_map_pages
[ Upstream commit bdc2ab5c61a5c07388f4820ff21e787b4dfd1ced ]

In rds_message_map_pages, the rm is freed by rds_message_put(rm).
But rm is still used by rm->data.op_sg in return value.

My patch assigns ERR_CAST(rm->data.op_sg) to err before the rm is
freed to avoid the uaf.

Fixes: 7dba92037b ("net/rds: Use ERR_PTR for rds_message_alloc_sgs()")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-14 08:42:09 +02:00
..
af_rds.c net: pass a sockptr_t into ->setsockopt 2020-07-24 15:41:54 -07:00
bind.c
cong.c net: rds: delete duplicated words 2020-09-18 14:12:43 -07:00
connection.c rds: If one path needs re-connection, check all and re-connect 2020-07-01 17:35:17 -07:00
ib_cm.c RDMA: Add rdma_connect_locked() 2020-10-28 09:14:49 -03:00
ib_frmr.c RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_mr.h RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_rdma.c RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_recv.c net/rds: suppress page allocation failure error in recv buffer refill 2020-10-09 12:32:03 -07:00
ib_ring.c
ib_send.c
ib_stats.c
ib_sysctl.c
ib.c RDMA: Remove 'max_fmr' 2020-06-02 20:32:54 -03:00
ib.h RDMA: Lift ibdev_to_node from rds to common code 2021-02-26 10:12:59 +01:00
info.c
info.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
loop.c
loop.h
Makefile RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
message.c net/rds: Fix a use after free in rds_message_map_pages 2021-04-14 08:42:09 +02:00
page.c
rdma_transport.c
rdma_transport.h net: rds: rdma_transport.h: delete duplicated word 2020-07-19 18:14:51 -07:00
rdma.c net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS 2021-02-17 11:02:30 +01:00
rds_single_path.h
rds.h net: pass a sockptr_t into ->setsockopt 2020-07-24 15:41:54 -07:00
recv.c rds: Prevent kernel-infoleak in rds_notify_queue_get() 2020-07-31 16:52:48 -07:00
send.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
stats.c
sysctl.c
tcp_connect.c
tcp_listen.c tcp: add tcp_sock_set_keepcnt 2020-05-28 11:11:45 -07:00
tcp_recv.c
tcp_send.c
tcp_stats.c
tcp.c
tcp.h tcp: add tcp_sock_set_keepcnt 2020-05-28 11:11:45 -07:00
threads.c
transport.c rds: transport module should be auto loaded when transport is set 2020-06-25 16:26:25 -07:00