public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Subject: x86/vdso/vdso2c: Memory Leak fix, Fix leak of variable name in vdso2c.c
@ 2022-04-22  7:09 ashamedbit
  2022-04-22  7:42 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: ashamedbit @ 2022-04-22  7:09 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, linux-kernel
  Cc: ashamedbit

The file vdso2c.c contains a memory leak of variable 'name'.
This leak was detected by ASAN(AddressSanitizer) on local  builds.
A tool called AddressWatcher automatically attempts to fix memory
leaks suggested by ASAN. The fix has been inserted to stop the
memory leak in the file vdso2c.c.

Signed-off-by: ashamedbit <muralianiruddhan@gmail.com>
---
 arch/x86/entry/vdso/vdso2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c
index edfe9780f6d1..b3decd59c98e 100644
--- a/arch/x86/entry/vdso/vdso2c.c
+++ b/arch/x86/entry/vdso/vdso2c.c
@@ -246,6 +246,7 @@ int main(int argc, char **argv)
 
 	go(raw_addr, raw_len, stripped_addr, stripped_len, outfile, name);
 
+	free(name);
 	munmap(raw_addr, raw_len);
 	munmap(stripped_addr, stripped_len);
 	fclose(outfile);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Subject: x86/vdso/vdso2c: Memory Leak fix, Fix leak of variable name in vdso2c.c
  2022-04-22  7:09 [PATCH] Subject: x86/vdso/vdso2c: Memory Leak fix, Fix leak of variable name in vdso2c.c ashamedbit
@ 2022-04-22  7:42 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2022-04-22  7:42 UTC (permalink / raw)
  To: ashamedbit
  Cc: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, linux-kernel

On Fri, Apr 22, 2022 at 03:09:22AM -0400, ashamedbit wrote:
> The file vdso2c.c contains a memory leak of variable 'name'.
> This leak was detected by ASAN(AddressSanitizer) on local  builds.
> A tool called AddressWatcher automatically attempts to fix memory
> leaks suggested by ASAN. The fix has been inserted to stop the
> memory leak in the file vdso2c.c.

I think you need to fix your tool, this is 3 lines before the program
terminates. Please explain how that is a leak?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-22  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22  7:09 [PATCH] Subject: x86/vdso/vdso2c: Memory Leak fix, Fix leak of variable name in vdso2c.c ashamedbit
2022-04-22  7:42 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox