From: Alexey Kuznetsov Date: Mon, 17 Apr 2006 11:39:23 +0000 (+0400) Subject: [PATCH] IPC: access to unmapped vmalloc area in grow_ary() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9a5cd5d2a57fb76dbae2115450f777b69beccf7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 --- diff --git a/ipc/util.c b/ipc/util.c index 5e785a29e1e6..b3dcfad3b4f7 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -183,8 +183,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; }