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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1287729412-24356-24-git-send-email-cota@braap.org>
Date:	Fri, 22 Oct 2010 02:36:45 -0400
From:	"Emilio G. Cota" <cota@...ap.org>
To:	Greg KH <greg@...ah.com>
Cc:	Martyn Welch <martyn.welch@...com>,
	LKML <linux-kernel@...r.kernel.org>,
	Juan David Gonzalez Cobas <david.cobas@...il.com>
Subject: [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed

From: Emilio G. Cota <cota@...ap.org>

buf_unalloc() frees the memory buffers allocated with vme_alloc_consistent.
The associated VME resource is needed in both vme_alloc_consistent and
vme_free_consistent; however the slave VME resources are being freed before
the calls to vme_free_consistent are made, which means the buffers
are never returned.

Fix this by freeing the VME resources only after the consistent buffers have
been returned.

Signed-off-by: Emilio G. Cota <cota@...ap.org>
---
 drivers/staging/vme/devices/vme_user.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 5def455..95c22ff 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -826,8 +826,8 @@ err_master:
 err_slave:
 	while (i > SLAVE_MINOR) {
 		i--;
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 err_class:
 	cdev_del(vme_user_cdev);
@@ -852,8 +852,8 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
 		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 
 	/* Unregister device driver */
-- 
1.7.1

--
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