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>] [day] [month] [year] [list]
Date:   Thu, 11 Oct 2018 16:35:22 +0100
From:   Colin King <colin.king@...onical.com>
To:     David Kershner <david.kershner@...sys.com>,
        sparmaintainer@...sys.com
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: visorbus: fix memory leak on parser_ctx

From: Colin Ian King <colin.king@...onical.com>

Currently when the call to visorchannel_signalinsert fails the error
return path does not free parser_ctx.  Fix this by kfree'ing it on
the error return path.

Detected by CoverityScan, CID#1451916 ("Resource leak")

Fixes: a35e3268da51 ("staging: unisys: visorchipset: remove local_addr in handle_command")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/visorbus/visorchipset.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/visorbus/visorchipset.c b/drivers/visorbus/visorchipset.c
index ca752b8f495f..09d1536edfb1 100644
--- a/drivers/visorbus/visorchipset.c
+++ b/drivers/visorbus/visorchipset.c
@@ -1383,8 +1383,10 @@ static int handle_command(struct controlvm_message inmsg, u64 channel_addr)
 	controlvm_init_response(&ackmsg, &inmsg.hdr, CONTROLVM_RESP_SUCCESS);
 	err = visorchannel_signalinsert(chipset_dev->controlvm_channel,
 					CONTROLVM_QUEUE_ACK, &ackmsg);
-	if (err)
+	if (err) {
+		kfree(parser_ctx);
 		return err;
+	}
 	switch (inmsg.hdr.id) {
 	case CONTROLVM_CHIPSET_INIT:
 		err = chipset_init(&inmsg);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ