mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
[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>
This commit is contained in:
parent
69cf0fac60
commit
a9a5cd5d2a
1 changed files with 1 additions and 2 deletions
|
@ -183,8 +183,7 @@ static int grow_ary(struct ipc_ids* ids, int newsize)
|
||||||
if(new == NULL)
|
if(new == NULL)
|
||||||
return size;
|
return size;
|
||||||
new->size = newsize;
|
new->size = newsize;
|
||||||
memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size +
|
memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size);
|
||||||
sizeof(struct ipc_id_ary));
|
|
||||||
for(i=size;i<newsize;i++) {
|
for(i=size;i<newsize;i++) {
|
||||||
new->p[i] = NULL;
|
new->p[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue