diff mbox series

[1/1] net/rds: Fix info leak in rds6_inc_info_copy()

Message ID 20190923235358.2297-2-tyhicks@canonical.com
State New
Headers show
Series CVE-2019-16714: RDS local info leak | expand

Commit Message

Tyler Hicks Sept. 23, 2019, 11:53 p.m. UTC
From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>

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>

CVE-2019-16714

(backported from commit 7d0a06586b2686ba80c4a2da5f91cb10ffbea736)
[tyhicks: Initialize minfo6.tos to 0 since the rds_incoming struct
 doesn't have a c_tos field due to 5.0 not containing commit
 3eb450367d08 ("rds: add type of service(tos) infrastructure")]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
---
 net/rds/recv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Connor Kuehl Sept. 24, 2019, 3:13 p.m. UTC | #1
On 9/23/19 4:53 PM, Tyler Hicks wrote:
> From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
> 
> 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>
> 
> CVE-2019-16714
> 
> (backported from commit 7d0a06586b2686ba80c4a2da5f91cb10ffbea736)
> [tyhicks: Initialize minfo6.tos to 0 since the rds_incoming struct
>   doesn't have a c_tos field due to 5.0 not containing commit
>   3eb450367d08 ("rds: add type of service(tos) infrastructure")]
> Signed-off-by: Tyler Hicks <tyhicks@canonical.com>

Acked-by: Connor Kuehl <connor.kuehl@canonical.com>

> ---
>   net/rds/recv.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/rds/recv.c b/net/rds/recv.c
> index 727639dac8a7..7ca2bc4bbc0d 100644
> --- a/net/rds/recv.c
> +++ b/net/rds/recv.c
> @@ -1,5 +1,5 @@
>   /*
> - * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved.
>    *
>    * This software is available to you under a choice of one of two
>    * licenses.  You may choose to be licensed under the terms of the GNU
> @@ -798,6 +798,7 @@ void rds6_inc_info_copy(struct rds_incoming *inc,
>   
>   	minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence);
>   	minfo6.len = be32_to_cpu(inc->i_hdr.h_len);
> +	minfo6.tos = 0;
>   
>   	if (flip) {
>   		minfo6.laddr = *daddr;
> @@ -811,6 +812,8 @@ void rds6_inc_info_copy(struct rds_incoming *inc,
>   		minfo6.fport = inc->i_hdr.h_dport;
>   	}
>   
> +	minfo6.flags = 0;
> +
>   	rds_info_copy(iter, &minfo6, sizeof(minfo6));
>   }
>   #endif
>
Sultan Alsawaf Sept. 25, 2019, 3:39 p.m. UTC | #2
On Mon, Sep 23, 2019 at 11:53:58PM +0000, Tyler Hicks wrote:
> From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
> 
> 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>
> 
> CVE-2019-16714
> 
> (backported from commit 7d0a06586b2686ba80c4a2da5f91cb10ffbea736)
> [tyhicks: Initialize minfo6.tos to 0 since the rds_incoming struct
>  doesn't have a c_tos field due to 5.0 not containing commit
>  3eb450367d08 ("rds: add type of service(tos) infrastructure")]
> Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
> ---
>  net/rds/recv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/rds/recv.c b/net/rds/recv.c
> index 727639dac8a7..7ca2bc4bbc0d 100644
> --- a/net/rds/recv.c
> +++ b/net/rds/recv.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms of the GNU
> @@ -798,6 +798,7 @@ void rds6_inc_info_copy(struct rds_incoming *inc,
>  
>  	minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence);
>  	minfo6.len = be32_to_cpu(inc->i_hdr.h_len);
> +	minfo6.tos = 0;
>  
>  	if (flip) {
>  		minfo6.laddr = *daddr;
> @@ -811,6 +812,8 @@ void rds6_inc_info_copy(struct rds_incoming *inc,
>  		minfo6.fport = inc->i_hdr.h_dport;
>  	}
>  
> +	minfo6.flags = 0;
> +
>  	rds_info_copy(iter, &minfo6, sizeof(minfo6));
>  }
>  #endif
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
diff mbox series

Patch

diff --git a/net/rds/recv.c b/net/rds/recv.c
index 727639dac8a7..7ca2bc4bbc0d 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -1,5 +1,5 @@ 
 /*
- * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -798,6 +798,7 @@  void rds6_inc_info_copy(struct rds_incoming *inc,
 
 	minfo6.seq = be64_to_cpu(inc->i_hdr.h_sequence);
 	minfo6.len = be32_to_cpu(inc->i_hdr.h_len);
+	minfo6.tos = 0;
 
 	if (flip) {
 		minfo6.laddr = *daddr;
@@ -811,6 +812,8 @@  void rds6_inc_info_copy(struct rds_incoming *inc,
 		minfo6.fport = inc->i_hdr.h_dport;
 	}
 
+	minfo6.flags = 0;
+
 	rds_info_copy(iter, &minfo6, sizeof(minfo6));
 }
 #endif