lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 26 Sep 2016 11:00:44 -0400
From:   Jason Baron <jbaron@...mai.com>
To:     davem@...emloft.net
Cc:     Yuval.Mintz@...gic.com, Ariel.Elior@...gic.com,
        netdev@...r.kernel.org
Subject: [PATCH net-next] bnx2x: free the mac filter group list before freeing the cmd

The group list must be freed prior to freeing the command otherwise
we have a use-after-free.

Signed-off-by: Jason Baron <jbaron@...mai.com>
Cc: Yuval Mintz <Yuval.Mintz@...gic.com>
Cc: Ariel Elior <Ariel.Elior@...gic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 4947a9c..cea6bdc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -2714,8 +2714,8 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
 			elem_group = (struct bnx2x_mcast_elem_group *)
 				     __get_free_page(GFP_ATOMIC | __GFP_ZERO);
 			if (!elem_group) {
-				kfree(new_cmd);
 				bnx2x_free_groups(&new_cmd->group_head);
+				kfree(new_cmd);
 				return -ENOMEM;
 			}
 			total_elems -= MCAST_MAC_ELEMS_PER_PG;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ