From: Horms <horms@verge.net.au>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] [SECURITY, 2.4] Avoid 'names_cache' memory leak with CONFIG_AUDITSYSCALL
Date: Fri, 28 Oct 2005 18:27:46 +0900 [thread overview]
Message-ID: <20051028092745.GL11045@verge.net.au> (raw)
This is CAN-2005-3181, and a backport of
829841146878e082613a49581ae252c071057c23 from Linus's 2.6 tree to 2.4.
Original Description and Sign-Off:
Avoid 'names_cache' memory leak with CONFIG_AUDITSYSCALL
The nameidata "last.name" is always allocated with "__getname()", and
should always be free'd with "__putname()".
Using "putname()" without the underscores will leak memory, because the
allocation will have been hidden from the AUDITSYSCALL code.
Arguably the real bug is that the AUDITSYSCALL code is really broken,
but in the meantime this fixes the problem people see.
Reported by Robert Derr, patch by Rick Lindsley.
Acked-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
My sign off, indicating I think it applies to 2.4:
Signed-off-by: Horms <horms@verge.net.au>
--- from-0001/fs/namei.c
+++ to-work/fs/namei.c 2005-10-11 18:23:56.000000000 +0900
@@ -1198,18 +1198,18 @@ do_link:
if (nd->last_type != LAST_NORM)
goto exit;
if (nd->last.name[nd->last.len]) {
- putname(nd->last.name);
+ __putname(nd->last.name);
goto exit;
}
error = -ELOOP;
if (count++==32) {
- putname(nd->last.name);
+ __putname(nd->last.name);
goto exit;
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
dentry = lookup_hash(&nd->last, nd->dentry);
- putname(nd->last.name);
+ __putname(nd->last.name);
goto do_last;
}
next reply other threads:[~2005-10-28 9:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-28 9:27 Horms [this message]
2005-10-28 10:00 ` [PATCH] [SECURITY, 2.4] Avoid 'names_cache' memory leak with CONFIG_AUDITSYSCALL Arjan van de Ven
2005-10-29 3:42 ` Horms
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=20051028092745.GL11045@verge.net.au \
--to=horms@verge.net.au \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.