]> git.baikalelectronics.ru Git - kernel.git/commit
Avoid 'names_cache' memory leak with CONFIG_AUDITSYSCALL
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 7 Oct 2005 04:54:21 +0000 (21:54 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 7 Oct 2005 04:54:21 +0000 (21:54 -0700)
commit7607bdc4ae226237bfeec315f7adbd85b0f84c8b
treeb38d26d6c99f043f14242351ac084f8b088a772b
parent08199a77be0f856148b2ea8ec08ea038884d3ea6
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>
fs/namei.c