From 5920e09fd9a236fd688762f7ceba1ada6c58a9be Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 16 Mar 2025 17:50:25 +0100 Subject: [PATCH] lkl: Remove the stat symbol hijack We are hijacking `stat`, where the size of the target struct is dependent on the wordsize. Delegating to `__xstat64` is incorrect, as it unconditionally uses the stat64 layout and will result in an out-of-bounds write on 32-bit architectures. The replacement would be to use `__xstat` as the implementation instead, but the requirements on the `vers` parameter make it hard to portably call. Since the symbol just delegates to the real implementation unconditionally and therefore does not seem to have a deeper purpose, just remove it. Fixes: d4b9b653a1cd ("lkl: update dpdk version to 17.02 from 2.2") Signed-off-by: Tim Schumacher --- tools/lkl/lib/hijack/hijack.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/lkl/lib/hijack/hijack.c b/tools/lkl/lib/hijack/hijack.c index 0dfe08aacb08d6..2b4adefbcbcd52 100644 --- a/tools/lkl/lib/hijack/hijack.c +++ b/tools/lkl/lib/hijack/hijack.c @@ -586,15 +586,6 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) return lkl_sys_mmap(addr, length, prot, flags, fd, offset); } -#ifndef __ANDROID__ -HOST_CALL(__xstat64) -int stat(const char *pathname, struct stat *buf) -{ - CHECK_HOST_CALL(__xstat64); - return host___xstat64(0, pathname, buf); -} -#endif - ssize_t send(int fd, const void *buf, size_t len, int flags) { return sendto(fd, buf, len, flags, 0, 0);