]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Allocate thunk size dynamically
authorAlexander Graf <agraf@suse.de>
Wed, 6 May 2015 21:47:32 +0000 (23:47 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 15 Jun 2015 08:36:58 +0000 (11:36 +0300)
commit8be656b87c6bb1b9f8af3ff78094413d71e4443a
tree08875ef1e84bb8197351907214f605a263e3329d
parent0a2df857a7038c75379cc575de5d4be4c0ac629e
linux-user: Allocate thunk size dynamically

We store all struct types in an array of static size without ever
checking whether we overrun it. Of course some day someone (like me
in another, ancient ALSA enabling patch set) will run into the limit
without realizing it.

So let's make the allocation dynamic. We already know the number of
structs that we want to allocate, so we only need to pass the variable
into the respective piece of code.

Also, to ensure we don't accidently overwrite random memory, add some
asserts to sanity check whether a thunk is actually part of our array.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
include/exec/user/thunk.h
linux-user/syscall.c
thunk.c