]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Fix the size limit of compat space msgsize
authorsuzuki <suzuki@linux.vnet.ibm.com>
Thu, 7 Dec 2006 04:37:48 +0000 (20:37 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:38 +0000 (08:39 -0800)
commit2a5b0b2452ecf2428d9b882cb7520a9d73181213
tree38c8bd3c461cb09a538664ddc78e5452fdf28f29
parent2d057cea5dc1b037eab0a93f36cde02a985a8e52
[PATCH] Fix the size limit of compat space msgsize

Currently we allocate 64k space on the user stack and use it the msgbuf for
sys_{msgrcv,msgsnd} for compat and the results are later copied in user [
by copy_in_user].  This patch introduces helper routines for
sys_{msgrcv,msgsnd} as below:

do_msgsnd() : Accepts the mtype and user space ptr to the buffer along with
the msqid and msgflg.

do_msgrcv() : Accepts a kernel space ptr to mtype and a userspace ptr to
the buffer.  The mtype has to be copied back the user space msgbuf by the
caller.

These changes avoid the need to allocate the msgsize on the userspace (
thus removing the size limt ) and the overhead of an extra copy_in_user().

Signed-off-by: Suzuki K P <suzuki@in.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/msg.h
ipc/compat.c
ipc/msg.c