diff options
author | Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> | 2006-04-17 15:39:23 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-17 18:40:40 -0700 |
commit | a9a5cd5d2a57fb76dbae2115450f777b69beccf7 (patch) | |
tree | 510318d8bebb35bb2e1bdaeb7dba0baf9bb073cd | |
parent | 69cf0fac6052c5bd3fb3469a41d4216e926028f8 (diff) | |
download | kernel_samsung_espresso10-a9a5cd5d2a57fb76dbae2115450f777b69beccf7.zip kernel_samsung_espresso10-a9a5cd5d2a57fb76dbae2115450f777b69beccf7.tar.gz kernel_samsung_espresso10-a9a5cd5d2a57fb76dbae2115450f777b69beccf7.tar.bz2 |
[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>
-rw-r--r-- | ipc/util.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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;i<newsize;i++) { new->p[i] = NULL; } |