fd-trans: Fix race condition on reallocation of the translation table.
authorOwen Anderson <oanderso@google.com>
Thu, 1 Jul 2021 22:12:55 +0000 (22:12 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 12 Jul 2021 19:54:46 +0000 (21:54 +0200)
commitc093364f4d911c1d59949b122f2d4c290986fff9
tree2f936418ccc6218017e4623641241eb7809fa97c
parent4f6a9f84f1d29b61e3ebd3bfd774d9fd5afe60c6
fd-trans: Fix race condition on reallocation of the translation table.

The mapping from file-descriptors to translator functions is not guarded
on realloc which may cause invalid function pointers to be read from a
previously deallocated mapping.

Signed-off-by: Owen Anderson <oanderso@google.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210701221255.107976-1-oanderso@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/fd-trans.c
linux-user/fd-trans.h
linux-user/main.c