Home Home > GIT Browse
diff options
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>2006-04-18 03:04:00 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-24 09:56:05 -0700
commit1fca16492a85f69fbdd498fdd66156f7de44262d (patch)
parent7517f43bef6016c58c007446f882ecf98a5e287b (diff)
[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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 862621980b01..303b05844f58 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;i<newsize;i++) {
new->p[i] = NULL;