summaryrefslogtreecommitdiff
path: root/net/rds/ib.c
diff options
context:
space:
mode:
authorSalvatore Mesoraca <s.mesoraca16@gmail.com>2018-03-12 00:07:49 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-12 22:06:59 +0300
commitf1cb9d68b4d8789d7f48bd293772095430860d86 (patch)
tree238171f3f41d78691100707d296c3612aaa8ab28 /net/rds/ib.c
parent3ed898e8cd0588152d9f0d7f472387c4af7f640e (diff)
downloadlinux-f1cb9d68b4d8789d7f48bd293772095430860d86.tar.xz
net: rds: drop VLA in rds_for_each_conn_info()
Avoid VLA[1] by using an already allocated buffer passed by the caller. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Salvatore Mesoraca <s.mesoraca16@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/ib.c')
-rw-r--r--net/rds/ib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c
index 50a88f3e7e39..02deee29e7f1 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -321,8 +321,11 @@ static void rds_ib_ic_info(struct socket *sock, unsigned int len,
struct rds_info_iterator *iter,
struct rds_info_lengths *lens)
{
+ u64 buffer[(sizeof(struct rds_info_rdma_connection) + 7) / 8];
+
rds_for_each_conn_info(sock, len, iter, lens,
rds_ib_conn_info_visitor,
+ buffer,
sizeof(struct rds_info_rdma_connection));
}