aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.c
diff options
context:
space:
mode:
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>2006-04-17 07:39:23 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-17 21:40:40 -0400
commita9a5cd5d2a57fb76dbae2115450f777b69beccf7 (patch)
tree510318d8bebb35bb2e1bdaeb7dba0baf9bb073cd /ipc/util.c
parent69cf0fac6052c5bd3fb3469a41d4216e926028f8 (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>
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c3
1 files changed, 1 insertions, 2 deletions
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)
183 if(new == NULL) 183 if(new == NULL)
184 return size; 184 return size;
185 new->size = newsize; 185 new->size = newsize;
186 memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size + 186 memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size);
187 sizeof(struct ipc_id_ary));
188 for(i=size;i<newsize;i++) { 187 for(i=size;i<newsize;i++) {
189 new->p[i] = NULL; 188 new->p[i] = NULL;
190 } 189 }