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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 18 Dec 2016 06:33:50 +0000
From:   "Mintz, Yuval" <Yuval.Mintz@...ium.com>
To:     Colin King <colin.king@...onical.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Elior, Ariel" <Ariel.Elior@...ium.com>,
        "Tayar, Tomer" <Tomer.Tayar@...ium.com>
Subject: RE: [PATCH] qed: fix memory leak of a qed_spq_entry on error failure
 paths

> From: Colin Ian King <colin.king@...onical.com>
> 
> A qed_spq_entry entry is allocated by qed_sp_init_request but is not kfree'd
> if an error occurs, causing a memory leak. Fix this by kfree'ing it and also
> setting *pp_ent to NULL to be safe.
> 
> Found with static analysis by CoverityScan, CIDs 1389468-1389470
> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
...
> +err:
> +	kfree(*pp_ent);
> +	*pp_ent = NULL;
> +
> +	return rc;
>  }

Hi Colin - thanks for this.
It would have been preferable to return the previously allocated spq entry.
I.e., do:

+err:
+	qed_spq_return_entry(p_hwfn, *pp_ent);
+	*pp_ent = NULL;
+	return rc;

Thanks,
Yuval

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ