This is for a pwnage challenge. I have two virtual machines. Both are running glibc 2.19. But, when I analyze the function offset in both, it is different in both of them.As per my knowledge, same version libc have same offsets. I searched over net but didn't find any convincing resolution. Below are the details on two machines:Machine 1:~$ objdump -d /lib/i386-linux-gnu/libc.so.6 | grep system00040190 <__libc_system>:~$ objdump -d /lib/i386-linux-gnu/libc.so.6 | grep IO_puts>00065650 <_IO_puts>:~$ ls -la /lib/i386-linux-gnu/libc.so.6lrwxrwxrwx 1 root root 12 Jan  9 04:28 /lib/i386-linux-gnu/libc.so.6 -> libc-2.19.so~$ readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system620: 00040190    56 FUNC    GLOBAL DEFAULT   12 __libc_system@@GLIBC_PRIVATE~$ readelf -s /lib/i386-linux-gnu/libc.so.6 | grep IO_puts203: 00065650   421 FUNC    GLOBAL DEFAULT   12 _IO_puts@@GLIBC_2.0~$ ls -l /lib/i386-linux-gnu/libc-2.19.so -rwxr-xr-x 1 root root 1754876 May 26  2016 /lib/i386-linux-gnu/libc-2.19.soMachine 2:~$ objdump -d /lib/i386-linux-gnu/libc.so.6 | grep system00040310 <__libc_system>:~$ objdump -d /lib/i386-linux-gnu/libc.so.6 | grep IO_puts>000657e0 <_IO_puts>:~$ ls -la /lib/i386-linux-gnu/libc.so.6lrwxrwxrwx 1 root root 12 Jan  9 04:28 /lib/i386-linux-gnu/libc.so.6 -> libc-2.19.so~$ readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system620: 00040310    56 FUNC    GLOBAL DEFAULT   12 __libc_system@@GLIBC_PRIVATE~$ readelf -s /lib/i386-linux-gnu/libc.so.6 | grep IO_puts203: 000657e0   421 FUNC    GLOBAL DEFAULT   12 _IO_puts@@GLIBC_2.0~$ ls -l /lib/i386-linux-gnu/libc-2.19.so -rwxr-xr-x 1 root root 1754876 Feb 25  2015 /lib/i386-linux-gnu/libc-2.19.soAny insight here will be appreciated. Thanks!
Different function offset for same libc version
glibc
same version libc have same offsetsClose, but not quite.  The same version of any library could have the same offsets if compiled by the same compiler, using the same optimization routines, targeting the same platform, using the same rules on instruction set extensions.  So for example, if one OS maintainer compiles libc with gcc version 5.4, another uses gcc version 6.3, and another uses clang, it's entirely possible that no offsets may match.As shared objects (.so) are dynamically linked position-independent code, it makes no difference under the hood: the functions that are called from a library that has been linked should behave as expected.On the other hand, if you've installed a pre-built libc from the same repo on 2 VMs with identical CPU configuration, then I'd say it bears further investigation.