linux-user: don't use AT_EXECFD in do_openat()
commit00ed8a3459869f46dbb4e18d4dcc81882dfe8776
authorLaurent Vivier <laurent@vivier.eu>
Tue, 27 Sep 2022 12:43:57 +0000 (27 14:43 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 21 Oct 2022 15:46:19 +0000 (21 17:46 +0200)
tree9909762e4f82dfb55374ee20d3ecea8596e55f29
parentf07eb1c4f805c0dcc14dd69fee49b601ce0b2d2c
linux-user: don't use AT_EXECFD in do_openat()

AT_EXECFD gives access to the binary file even if
it is not readable (only executable).

Moreover it can be opened with flags and mode that are not the ones
provided by do_openat() caller.

And it is not available because loader_exec() has closed it.

To avoid that, use only safe_openat() with the exec_path.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220927124357.688536-3-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c