kernel-hacking-2024-linux-s.../arch
Andrew Morton d64d387372 [NET]: Fix memory leak in sys_{send,recv}msg() w/compat
From: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>

sendmsg()/recvmsg() syscalls from o32/n32 apps to a 64bit kernel will
cause a kernel memory leak if iov_len > UIO_FASTIOV for each syscall!

This is because both sys_sendmsg() and verify_compat_iovec() kmalloc a
new iovec structure.  Only the one from sys_sendmsg() is free'ed.

I wrote a simple test program to confirm this after identifying the
problem:

http://davej.org/programs/testsendmsg.c

Note that the below fix will break solaris_sendmsg()/solaris_recvmsg() as
it also calls verify_compat_iovec() but expects it to malloc internally.

[ I fixed that. -DaveM ]

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-08-09 15:29:19 -07:00
..
alpha [PATCH] pci and yenta: pcibios_bus_to_resource 2005-08-04 21:32:46 -07:00
arm [PATCH] pci and yenta: pcibios_bus_to_resource 2005-08-04 21:32:46 -07:00
arm26 It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
cris It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
frv It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
h8300
i386 [PATCH] Move the fix to align node_end_pfns to a proper location 2005-08-07 10:00:39 -07:00
ia64 [PATCH] remove sys_set_zone_reclaim() 2005-08-01 10:03:56 -07:00
m32r [PATCH] m32r: Fix local-timer event handling 2005-08-01 21:37:59 -07:00
m68k It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
m68knommu
mips
parisc It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
ppc [PATCH] ppc32: Fix MPC834x USB memory map offsets 2005-08-08 15:29:13 -07:00
ppc64 [PATCH] ppc64: update defconfigs 2005-08-08 11:46:24 -07:00
s390 [PATCH] s390: ioprio & inotify system calls. 2005-08-01 21:37:59 -07:00
sh
sh64 It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
sparc
sparc64 [NET]: Fix memory leak in sys_{send,recv}msg() w/compat 2005-08-09 15:29:19 -07:00
um [PATCH] uml: fix vsyscall brokenness 2005-07-29 15:01:14 -07:00
v850
x86_64 [PATCH] x86_64: add MODULE_ALIAS for aes 2005-08-08 15:29:13 -07:00
xtensa