Re: loop: Too many partitions and OOM killer?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tetsuo,

On 03/20/2019 07:42 PM, Tetsuo Handa wrote:
> Hello.
> 
> syzbot is sometimes generating corrupted reports like
> https://syzkaller.appspot.com/text?tag=CrashLog&x=14f62a8b200000 .
> 
> The report includes flood of global OOM killer invocations, and I suspect
> that the reason of global OOM killer invocations is a lot of "blkid" processes
> (invoked by uevent?) after manipulating loop devices with a lot of partitions.
> 
> Can "blkid" be invoked asynchronously upon manipulating loop devices?

I am not sure.

Therefore I have tested on Ubuntu 16.04.5 VM running default 4.15.0-46-generic.


1. I hooked blkid by a proxy bash script. If blkid is involved, the related
syslog will be printed to /var/log/syslog by 'logger':

$ cat /sbin/blkid

#!/bin/sh

/sbin/blkid-bin $*
logger "blkid $*"


2. Then I started to monitor udev messages via 'udevadm monitor'.

3. Finally, I did the test with below command set and there would be two
partitions involved:

# dd if=/dev/zero of=tmp.raw bs=1M count=100 oflag=direct
# parted tmp.raw --script mklabel msdos mkpart primary 0% 50% mkpart primary 50%
100%
# losetup -P /dev/loop0 tmp.raw
# losetup -d /dev/loop0


Below are the udev messages captured during the test.

For 'losetup -P /dev/loop0 tmp.raw':

KERNEL[140.622809] change   /devices/virtual/block/loop0 (block)
KERNEL[140.640550] change   /devices/virtual/block/loop0 (block)
KERNEL[140.640601] add      /devices/virtual/block/loop0/loop0p1 (block)
KERNEL[140.640625] add      /devices/virtual/block/loop0/loop0p2 (block)
UDEV  [140.676169] change   /devices/virtual/block/loop0 (block)
UDEV  [140.692198] change   /devices/virtual/block/loop0 (block)
UDEV  [140.701744] add      /devices/virtual/block/loop0/loop0p1 (block)
UDEV  [140.724253] add      /devices/virtual/block/loop0/loop0p2 (block)


For 'losetup -d /dev/loop0':

KERNEL[159.504382] change   /devices/virtual/block/loop0 (block)
KERNEL[159.504718] remove   /devices/virtual/block/loop0/loop0p1 (block)
KERNEL[159.504758] remove   /devices/virtual/block/loop0/loop0p2 (block)
UDEV  [159.505807] change   /devices/virtual/block/loop0 (block)
UDEV  [159.506201] remove   /devices/virtual/block/loop0/loop0p1 (block)
UDEV  [159.507036] remove   /devices/virtual/block/loop0/loop0p2 (block)


There is NO blkid log printed to /var/log/syslog and I would assume blkid is not
involved.

This is just a test on ubuntu 16.04.5. I am not sure about the env of syzbot.

Dongli Zhang



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux