Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] POSIX MQ audit memory leak fix
@ 2006-06-12 19:41 George C. Wilson
  0 siblings, 0 replies; only message in thread
From: George C. Wilson @ 2006-06-12 19:41 UTC (permalink / raw)
  To: linux-audit

This is an incremental patch that addresses a memory leak in the POSIX message
queue audit patch.  It applies cleanly to Al Viro's lspp.b19 git branch.  Many
thanks to Linda Knippers for pointing out the issue.

Please apply.

 auditsc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Signed-off-by: George Wilson <ltcgcw@us.ibm.com>

--

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ba8520d..276bde6 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1427,8 +1427,10 @@ int __audit_mq_timedreceive(mqd_t mqdes,
 		return -ENOMEM;
 
 	if (u_msg_prio != NULL) {
-		if (get_user(ax->msg_prio, u_msg_prio))
+		if (get_user(ax->msg_prio, u_msg_prio)) {
+			kfree(ax);
 			return -EFAULT;
+		}
 	} else
 		ax->msg_prio = 0;
 
-- 
George Wilson <ltcgcw@us.ibm.com>
IBM Linux Technology Center

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-12 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-12 19:41 [PATCH] POSIX MQ audit memory leak fix George C. Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox