From: Alexey Kuznetsov Date: Tue, 18 Apr 2006 03:04:00 +0000 (+0000) Subject: [PATCH] IPC: access to unmapped vmalloc area in grow_ary() X-Git-Tag: v2.6.16.10~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fca16492a85f69fbdd498fdd66156f7de44262d;p=thirdparty%2Fkernel%2Fstable.git [PATCH] IPC: access to unmapped vmalloc area in grow_ary() grow_ary() should not copy struct ipc_id_ary (it copies new->p, not new). Due to this, memcpy() src pointer could hit unmapped vmalloc page when near page boundary. Found during OpenVZ stress testing Signed-off-by: Alexey Kuznetsov Signed-off-by: Kirill Korotaev Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/ipc/util.c b/ipc/util.c index 862621980b019..303b05844f58a 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -182,8 +182,7 @@ static int grow_ary(struct ipc_ids* ids, int newsize) if(new == NULL) return size; new->size = newsize; - memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size + - sizeof(struct ipc_id_ary)); + memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size); for(i=size;ip[i] = NULL; }