Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "George C. Wilson" <ltcgcw@us.ibm.com>
To: linux-audit@redhat.com
Subject: [PATCH] POSIX MQ audit memory leak fix
Date: Mon, 12 Jun 2006 14:41:49 -0500	[thread overview]
Message-ID: <20060612194149.GA9006@us.ibm.com> (raw)

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

                 reply	other threads:[~2006-06-12 19:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060612194149.GA9006@us.ibm.com \
    --to=ltcgcw@us.ibm.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox