Comment 17 for bug 1906250

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2021-01-21 05:06 EDT-------
You are right, I've just successfully run a small helloworld on groovy:
qemu-s390x -L /usr/s390x-linux-gnu ./helloworld-s390x
Hello world

I've used these packages:
libc-bin/groovy-proposed,now 2.32-0ubuntu3.1 amd64 [installed,automatic]
libc6/groovy-proposed,now 2.32-0ubuntu3.1 amd64 [installed,automatic]
libc6-s390x-cross/groovy,now 2.32-0ubuntu3cross2 all [installed]
As far as I understand, this libc6-s390x-cross package is based on older libc6-2.32-0ubuntu3 package.

Note that the used libc6-package writes the endianess marker to ld.so.cache. But the libc6-s390x-cross does not check for this endianess marker (the patch git-elf-Add-endianness-markup-to-ld.so.cache-bug-27008.patch was added with newer libc6-2.32-0ubuntu3.1 package)!

But as glibc-2.32 is used, there is the enhanced corruption check. This time, I haven't debugged it, but I assume that this is the reason, why the helloworld works on groovy):
if (file != MAP_FAILED && cachesize > sizeof *cache_new
&& memcmp (file, CACHEMAGIC_VERSION_NEW,
sizeof CACHEMAGIC_VERSION_NEW - 1) == 0
/* Check for corruption, avoiding overflow. */
&& ((cachesize - sizeof *cache_new) / sizeof (struct file_entry_new)
>= ((struct cache_file_new *) file)->nlibs))
{

Note that the focal libc6/libc6-s390x-cross packages both have the endianess marker patch, but are missing this corruption check. See my previous comment with
### Missing the "Check for corruption, avoiding overflow." here. ###