Skip to content

Commit 5920e09

Browse files
committedMar 18, 2025·
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: d4b9b65 ("lkl: update dpdk version to 17.02 from 2.2") Signed-off-by: Tim Schumacher <[email protected]>
1 parent 1219089 commit 5920e09

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed
 

‎tools/lkl/lib/hijack/hijack.c

-9
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,6 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
586586
return lkl_sys_mmap(addr, length, prot, flags, fd, offset);
587587
}
588588

589-
#ifndef __ANDROID__
590-
HOST_CALL(__xstat64)
591-
int stat(const char *pathname, struct stat *buf)
592-
{
593-
CHECK_HOST_CALL(__xstat64);
594-
return host___xstat64(0, pathname, buf);
595-
}
596-
#endif
597-
598589
ssize_t send(int fd, const void *buf, size_t len, int flags)
599590
{
600591
return sendto(fd, buf, len, flags, 0, 0);

0 commit comments

Comments
 (0)
Please sign in to comment.