]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] IPC: access to unmapped vmalloc area in grow_ary()
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Tue, 18 Apr 2006 03:04:00 +0000 (03:04 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 24 Apr 2006 16:56:05 +0000 (09:56 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ipc/util.c

index 862621980b01919ff7fee486a36f342aff33d2d0..303b05844f58affbb353c0faa6e76d386dcc390a 100644 (file)
@@ -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;i<newsize;i++) {
                new->p[i] = NULL;
        }