netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info()
@ 2014-05-23 16:37 Dan Carpenter
  2014-05-24 18:01 ` David Miller
  2014-05-26  5:28 ` Sucheta Chakraborty
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-05-23 16:37 UTC (permalink / raw)
  To: Shahed Shaikh, Sucheta Chakraborty
  Cc: Dept-HSGLinuxNICDev, netdev, kernel-janitors

This function is called from dcbnl_build_peer_app().  The "info"
struct isn't initialized at all so we disclose 2 bytes of uninitialized
stack data.  We should clear it before passing it to the user.

Fixes: 48365e485275 ('qlcnic: dcb: Add support for CEE Netlink interface.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static analysis patch, and I am not familiar with this code.
We may want to put some useful information here, to go with the
app_count.

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
index a51fe18..561cb11 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
@@ -1020,6 +1020,7 @@ static int qlcnic_dcb_peer_app_info(struct net_device *netdev,
 	struct qlcnic_dcb_cee *peer;
 	int i;
 
+	memset(info, 0, sizeof(*info));
 	*app_count = 0;
 
 	if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info()
  2014-05-23 16:37 [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info() Dan Carpenter
@ 2014-05-24 18:01 ` David Miller
  2014-05-26  5:28 ` Sucheta Chakraborty
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-05-24 18:01 UTC (permalink / raw)
  To: dan.carpenter
  Cc: shahed.shaikh, sucheta.chakraborty, Dept-HSGLinuxNICDev, netdev,
	kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 23 May 2014 19:37:21 +0300

> This function is called from dcbnl_build_peer_app().  The "info"
> struct isn't initialized at all so we disclose 2 bytes of uninitialized
> stack data.  We should clear it before passing it to the user.
> 
> Fixes: 48365e485275 ('qlcnic: dcb: Add support for CEE Netlink interface.')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is a static analysis patch, and I am not familiar with this code.
> We may want to put some useful information here, to go with the
> app_count.

I've applied this and queued it up for -stable, thanks Dan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info()
  2014-05-23 16:37 [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info() Dan Carpenter
  2014-05-24 18:01 ` David Miller
@ 2014-05-26  5:28 ` Sucheta Chakraborty
  1 sibling, 0 replies; 3+ messages in thread
From: Sucheta Chakraborty @ 2014-05-26  5:28 UTC (permalink / raw)
  To: Dan Carpenter, Shahed Shaikh
  Cc: Dept-HSG Linux NIC Dev, netdev, kernel-janitors@vger.kernel.org

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Friday, May 23, 2014 10:07 PM
> To: Shahed Shaikh; Sucheta Chakraborty
> Cc: Dept-HSG Linux NIC Dev; netdev; kernel-janitors@vger.kernel.org
> Subject: [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info()
> 
> This function is called from dcbnl_build_peer_app().  The "info"
> struct isn't initialized at all so we disclose 2 bytes of uninitialized
> stack data.  We should clear it before passing it to the user.
> 
> Fixes: 48365e485275 ('qlcnic: dcb: Add support for CEE Netlink
> interface.')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

Thanks,
Sucheta.

> ---
> This is a static analysis patch, and I am not familiar with this code.
> We may want to put some useful information here, to go with the
> app_count.
> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
> index a51fe18..561cb11 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
> @@ -1020,6 +1020,7 @@ static int qlcnic_dcb_peer_app_info(struct
> net_device *netdev,
>  	struct qlcnic_dcb_cee *peer;
>  	int i;
> 
> +	memset(info, 0, sizeof(*info));
>  	*app_count = 0;
> 
>  	if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-26  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 16:37 [patch] qlcnic: info leak in qlcnic_dcb_peer_app_info() Dan Carpenter
2014-05-24 18:01 ` David Miller
2014-05-26  5:28 ` Sucheta Chakraborty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).