FS#36532 - Udev running out of memory

Attached to Project: Arch Linux
Opened by piroflip (piroflip) - Wednesday, 14 August 2013, 20:16 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Wednesday, 14 August 2013, 22:28 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Upon running Arch Linux install iso, system keep running out of memory and oom-killer stops udevd proccess.
Log full of messages like "Out of Memory: Killed process 94 (udev)"

Additional info:
* package version(s)
archlinux-2013.08.01-dual.iso
* config and/or log files etc.

Steps to reproduce:
run qemu with archlinux-2013.08.01-dual.iso and disk image attached

xxd -r bug_disk.hex > bug_disk.img
qemu-system-i386 -hda archlinux-2013.08.01-dual.iso -hdb bug_disk.img

I discovered problem and don't certainly know to which project it belongs to, udev or kernel.

This disk image contains erroneously created partition table with recursive extended partition, pointing to primary partition table. In that case, code at linux kernel creates as many as 256 partitions (actualy partition number limit)
See http://lxr.linux.no/#linux+v3.10.6/block/partitions/msdos.c#L202

And udev tries to enumerate all of them and I think running out of mem. This is strange and needs further investigation.

At my point of view, kernel have to detect partition recursion and stop further device creation.
Similar code exist in parted project.
See http://git.savannah.gnu.org/cgit/parted.git/tree/libparted/labels/dos.c#n990





This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Wednesday, 14 August 2013, 22:28 GMT
Reason for closing:  Upstream
Comment by Dave Reisner (falconindy) - Wednesday, 14 August 2013, 20:24 GMT
So, you're surprised that a handcrafted, completely broken and unusable partition table results in applications behaving badly?

If you want to fix this, go fix the kernel. udev is only the messenger. Your VM is ill equipped to do much of anything with only 128MB of RAM.
Comment by piroflip (piroflip) - Wednesday, 14 August 2013, 21:54 GMT
Yes, I am a little bit surprised )) It is like saying "Are you surprised that broken ip packet came from nowhere in the internet broke up your system"? Doesn't matter how this partition was made, Linux just shouldnt fail. How can I fix it if I can't boot Linux with it? I can't even zero it out. You are wrong thinking this is only happening in low memory qemu system. Actualy, I stuck upon this on super-up-to-date Intel server platform with 6GB RAM on it.

I can go on kernel mailing list, no problem with that, just wanted to discuss this at Arch, as I always thought, it has the best supporting crowd.
Comment by Jan de Groot (JGC) - Wednesday, 14 August 2013, 22:02 GMT
handcrafted or not, if you put this on a USB stick and hand it out to someone who has important unsaved work on his system while plugging it in, that user won't be happy about it.

IMHO this should go upstream to kernel developers, kernel should detect the malformed recursive partition table and abort without enumerating anything at all.

Loading...