Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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 <kuznet@ms2.inr.ac.ru>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Alexey Kuznetsov and committed by
Linus Torvalds
a9a5cd5d 69cf0fac

+1 -2
+1 -2
ipc/util.c
··· 183 183 if(new == NULL) 184 184 return size; 185 185 new->size = newsize; 186 - memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size + 187 - sizeof(struct ipc_id_ary)); 186 + memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size); 188 187 for(i=size;i<newsize;i++) { 189 188 new->p[i] = NULL; 190 189 }