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]
Message-ID: <tkrat.25648a77ea40c9e3@s5r6.in-berlin.de>
Date:	Thu, 19 Jul 2007 09:28:42 +0200 (CEST)
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	stable@...nel.org
cc:	linux-kernel@...r.kernel.org,
	Kristian Høgsberg <krh@...hat.com>
Subject: [PATCH 2.6.22.y] firewire: fix memory leak of fw_request instances

Date: Tue, 17 Jul 2007 02:15:36 +0200 (CEST)
From: Stefan Richter <stefanr@...6.in-berlin.de>
Subject: firewire: fix memory leak of fw_request instances

Found and debugged by Jay Fenlason <fenlason@...hat.com>.
The bug was especially noticeable with direct I/O over fw-sbp2.

Signed-off-by: Stefan Richter <stefanr@...6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@...hat.com>
---
Same as commit 9c9bdf4d50730fd04b06077e22d7a83b585f26b5.

 drivers/firewire/fw-transaction.c |    4 +++-
 drivers/firewire/fw-transaction.h |    4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6.22/drivers/firewire/fw-transaction.c
===================================================================
--- linux-2.6.22.orig/drivers/firewire/fw-transaction.c
+++ linux-2.6.22/drivers/firewire/fw-transaction.c
@@ -605,8 +605,10 @@ fw_send_response(struct fw_card *card, s
 	 * check is sufficient to ensure we don't send response to
 	 * broadcast packets or posted writes.
 	 */
-	if (request->ack != ACK_PENDING)
+	if (request->ack != ACK_PENDING) {
+		kfree(request);
 		return;
+	}
 
 	if (rcode == RCODE_COMPLETE)
 		fw_fill_response(&request->response, request->request_header,
Index: linux-2.6.22/drivers/firewire/fw-transaction.h
===================================================================
--- linux-2.6.22.orig/drivers/firewire/fw-transaction.h
+++ linux-2.6.22/drivers/firewire/fw-transaction.h
@@ -124,6 +124,10 @@ typedef void (*fw_transaction_callback_t
 					  size_t length,
 					  void *callback_data);
 
+/*
+ * Important note:  The callback must guarantee that either fw_send_response()
+ * or kfree() is called on the @request.
+ */
 typedef void (*fw_address_callback_t)(struct fw_card *card,
 				      struct fw_request *request,
 				      int tcode, int destination, int source,

-- 
Stefan Richter
-=====-=-=== -=== =--==
http://arcgraph.de/sr/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ