Xen domU passwd file overwritten with console log output

Posted by malfy on Server Fault See other posts from Server Fault or by malfy
Published on 2012-11-23T03:29:22Z Indexed on 2012/11/23 5:00 UTC
Read the original article Hit count: 367

Filed under:
|

I was setting up a Debian Xen domU and after booting it fine, I added basic configuration to /etc/network/interfaces and ran /etc/init.d/networking restart. This failed so I decided to reboot. After the reboot I also ran xm shutdown box.

When dropped to a shell prompt it wouldn't let me login. Upon further inspection, I now have garbage in some critical files in /etc:

root@box:/# tail +1 mnt/etc/{passwd-,shadow}
tail: cannot open `+1' for reading: No such file or directory
==> mnt/etc/passwd- <==
0000000000100000 (reserved)
Nov 23 02:02:39 box kernel: [    0.000000]  Xen: 0000000000100000 - 0000000004000000 (usable)
Nov 23 02:02:39 box kernel: [    0.000000] DMI not present or invalid.
Nov 23 02:02:39 box kernel: [    0.000000] last_pfn = 0x4000 max_arch_pfn = 0x1000000
Nov 23 02:02:39 box kernel: [    0.000000] initial memory mapped : 0 - 033ff000
Nov 23 02:02:39 box kernel: [    0.000000] init_memory_mapping: 0000000000000000-0000000004000000
Nov 23 02:02:39 box kernel: [    0.000000] NX (Execute Disable) protection: active
Nov 23 02:02:39 box kernel: [    0.000000]  0000000000 - 0004000000 page 4k
Nov 23 02:02:39 box kernel: [    0.000000] kernel direct mapping tables up to 4000000 @ 7000-2c000
Nov 23 02:02:3
==> mnt/etc/shadow <==
32 nr_cpumask_bits:32 nr_cpu_ids:1 nr_node_ids:1
Nov 23 02:02:39 box kernel: [    0.000000] PERCPU: Embedded 15 pages/cpu @c15b0000 s37688 r0 d23752 u65536
Nov 23 02:02:39 box kernel: [    0.000000] pcpu-alloc: s37688 r0 d23752 u65536 alloc=16*4096
Nov 23 02:02:39 box kernel: [    0.000000] pcpu-alloc: [0] 0 
Nov 23 02:02:39 box kernel: [    0.000000] Xen: using vcpu_info placement
Nov 23 02:02:39 box kernel: [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16160
Nov 23 02:02:39 box kernel: [    0.000000] Kernel command line: root=/dev/mapper/xen-guest_root ro  quiet root=/dev/xvda1 ro 
Nov 23 02:02:39 box kernel: [    0.000000] PID hash table entries:

The garbage is also present in the passwd file and the group file (although I didn't paste that above since I have since ran debootstrap on the filesystem again). Does anyone have any insight into what happened and why?

© Server Fault or respective owner

Related posts about xen

Related posts about passwd