diff options
author | Ka-Cheong Poon <ka-cheong.poon@oracle.com> | 2019-08-26 05:39:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-27 23:56:06 -0400 |
commit | 7d0a06586b2686ba80c4a2da5f91cb10ffbea736 (patch) | |
tree | 99abaf39f03a2c94e52a82fe984f2a20b47d650d | |
parent | 2c1644cf6d46a8267d79ed95cb9b563839346562 (diff) |
net/rds: Fix info leak in rds6_inc_info_copy()
The rds6_inc_info_copy() function has a couple struct members which
are leaking stack information. The ->tos field should hold actual
information and the ->flags field needs to be zeroed out.
Fixes: 3eb450367d08 ("rds: add type of service(tos) infrastructure")
Fixes: b7ff8b1036f0 ("rds: Extend RDS API for IPv6 support")
Reported-by: 黄ID蝴蝶 <butterflyhuangxx@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/rds/recv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/rds/recv.c b/net/rds/recv.c index 853de4876088..a42ba7fa06d5 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved. | 2 | * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -811,6 +811,7 @@ void rds6_inc_info_copy(struct rds_incoming *inc, | |||
811 | 811 | ||
812 | minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence); | 812 | minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence); |
813 | minfo6.len = be32_to_cpu(inc->i_hdr.h_len); | 813 | minfo6.len = be32_to_cpu(inc->i_hdr.h_len); |
814 | minfo6.tos = inc->i_conn->c_tos; | ||
814 | 815 | ||
815 | if (flip) { | 816 | if (flip) { |
816 | minfo6.laddr = *daddr; | 817 | minfo6.laddr = *daddr; |
@@ -824,6 +825,8 @@ void rds6_inc_info_copy(struct rds_incoming *inc, | |||
824 | minfo6.fport = inc->i_hdr.h_dport; | 825 | minfo6.fport = inc->i_hdr.h_dport; |
825 | } | 826 | } |
826 | 827 | ||
828 | minfo6.flags = 0; | ||
829 | |||
827 | rds_info_copy(iter, &minfo6, sizeof(minfo6)); | 830 | rds_info_copy(iter, &minfo6, sizeof(minfo6)); |
828 | } | 831 | } |
829 | #endif | 832 | #endif |