[Bug 1302605] Re: Calls to /libx32/ld-linux-x32.so.2 hang when using auditd

Philipp Kern pkern at google.com
Fri May 23 14:23:13 UTC 2014


I think this should fix it:

 % diff -Naur /tmp/entry_64.S.orig arch/x86/kernel/entry_64.S
--- /tmp/entry_64.S.orig	2014-05-23 16:12:58.136925093 +0200
+++ arch/x86/kernel/entry_64.S	2014-05-23 16:13:12.229077570 +0200
@@ -699,6 +699,9 @@
 	movq %rsi,%rcx			/* 4th arg: 2nd syscall arg */
 	movq %rdi,%rdx			/* 3rd arg: 1st syscall arg */
 	movq %rax,%rsi			/* 2nd arg: syscall number */
+#if __SYSCALL_MASK != ~0
+	andl $__SYSCALL_MASK,%esi
+#endif
 	movl $AUDIT_ARCH_X86_64,%edi	/* 1st arg: audit arch */
 	call __audit_syscall_entry
 	LOAD_ARGS 0		/* reload call-clobbered registers */

The audit entry point expects a non-x32 syscall number in %esi. If the
x32 bit is set, it will break horribly by indexing wrongly into the
e->rule.mask[word] syscall bitmask. If we reuse the x32 mask (if the
kernel is compiled with x32 support), we should be safe. This is already
done at various points but syscall_trace_enter called later relies on
the bit being set. Otherwise strace will be unaware of the x32 mode and
report syscall_$(512+x) instead of the real syscalls.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1302605

Title:
  Calls to /libx32/ld-linux-x32.so.2 hang when using auditd

Status in “linux” package in Ubuntu:
  Confirmed
Status in “linux” source package in Trusty:
  New

Bug description:
  I'm running trusty on a bunch of machines, doing frequent dist-
  upgrades.  My hosts have gcc-multilib installed.

  Yesterday, I noticed that initramfs generation was hanging.  Today I
  investigated further and found out that what was hanging were the
  calls to /libx32/ld-linux-x32.so.2.

  This is triggered in initramfs generation because there are at some
  hooks that incorrectly use copy_exec to copy shell scripts into the
  initramfs image.  In a working machine, when ldd encounters a shell
  script, it will first call the 64bit linker and since it fails, it
  will then call the 32bit linker which will also fail.

  However, in a machine affected by this bug, the second call will hang
  forever, preventing new image generation, and package updates in
  general, when this happens as a trigger for update-initramfs.

  Originally I thought this was related to the kernel version, since I
  was unable to reproduce in a freshly installed machine running -22 and
  was reproducing it in a machine running -20, but now I'm also
  reproducing it in a machine running -22, so it must be something else.

  I'm sorry I can't provide the exact cause right now, but I think it's
  worth noting that in some situation there might be a problem, and try
  to find out which those situations are.

  I now have one host running 3.13.0-22-generic, with
  libc6-x32=2.19-0ubuntu3, where doing ldd /usr/bin/ldd hangs, and
  another host, with the exact same kernel and libc6-x32 version where
  doing ldd /usr/bin/ldd produces the expected error message (not a
  dynamic executable).  The main difference is that the first one was
  installed yesterday and the second one was installed today.  Both are
  dist-upgraded to the latest version of everything.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1302605/+subscriptions



More information about the foundations-bugs mailing list