Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ksym buffer overrun on 32 bit platforms
Commit 78074c5 ("info: expose more prog jited info"), which made its way into v0.17.0, resulted in random runc CI failures when running i386 binary on an amd64 kernel (see [1]). Apparently [2], the kernel always returns 64-bit pointers, so uint64 (rather than uintptr) should be used for ksyms slice regardless of the platform to avoid the buffer overrun. Now, to keep the public API of (*ProgramInfo).JitedKsymAddrsintact intact, convert those addresses back to uintptr, as it was done before commit 78074c5). Except, if the kernel address won't fit into uintptr (as it is the case when running i386 binary on an amd64 kernel), return an empty slice and a false, rather than incorrect addresses. [1]: opencontainers/runc#4594 [2]: https://github.com/torvalds/linux/blob/2014c95afecee3e76ca4a56956a936e23283f05b/kernel/bpf/syscall.c#L4840-L4846 Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information