From mboxrd@z Thu Jan 1 00:00:00 1970 From: "George C. Wilson" Subject: [PATCH] POSIX MQ audit memory leak fix Date: Mon, 12 Jun 2006 14:41:49 -0500 Message-ID: <20060612194149.GA9006@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5CJg1mZ003649 for ; Mon, 12 Jun 2006 15:42:01 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx3.redhat.com (8.13.1/8.13.1) with ESMTP id k5CJftT1015752 for ; Mon, 12 Jun 2006 15:41:55 -0400 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5CJfoBn008498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jun 2006 15:41:50 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.13.6/NCO/VER7.0) with ESMTP id k5CJfdOd293880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 12 Jun 2006 13:41:39 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k5CJfnnQ026772 for ; Mon, 12 Jun 2006 13:41:49 -0600 Received: from us.ibm.com (ea.austin.ibm.com [9.53.40.26]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5CJfnJO026745 for ; Mon, 12 Jun 2006 13:41:49 -0600 Received: (from gcwilson@localhost) by us.ibm.com (8.13.4/8.13.4/Submit) id k5CJfnph009108 for linux-audit@redhat.com; Mon, 12 Jun 2006 14:41:49 -0500 Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com 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 -- 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 IBM Linux Technology Center