target-s390x: Only access allocated storage keys
authorAlexander Graf <agraf@suse.de>
Wed, 3 Jun 2015 22:52:44 +0000 (00:52 +0200)
committerAlexander Graf <agraf@suse.de>
Thu, 4 Jun 2015 23:38:00 +0000 (01:38 +0200)
commit9814fed0afa73f5c37f04e02ec17c915a5d59303
treefa2bb7c8e673f857834cff32be2c3d8f8dadd6d9
parent068593deea6cc61b06243a33c7fcfadb1650b654
target-s390x: Only access allocated storage keys

We allocate ram_size / PAGE_SIZE storage keys, so we need to make sure that
we only access that many. Unfortunately the code can overrun this array by
one, potentially overwriting unrelated memory.

Fix it by limiting storage keys to their scope.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
target-s390x/mmu_helper.c