[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] 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(-)

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]