Skip to contentSkip to conversation

POSIX MQ audit memory leak fix

PATCH New George C. Wilson 1 participant 1 message Jun 12, 2006 Audit

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 POSIX MQ audit memory leak fix

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

--

kernel/auditsc.c +3 -1
index ba8520d..276bde6 100644
@@ -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;
 
Signature · 2 lines
George Wilson <[email protected]>
IBM Linux Technology Center