inotify fd leak
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Medium
|
Unassigned | ||
Quantal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I'm running Ubuntu 12.04 in a VM. After a recent kernel upgrade, I'm finding that I can reliably put the system in a position where the inotify_init() syscall returns -EMFILE, but /proc/*/fd shows fewer "anon_inode:
Perhaps a regression of CVE-2010-4250?
adar@adar-dev:~$ for foo in /proc/*/fd/*; do readlink -f $foo; done | grep inotify | sort | wc -l
24
adar@adar-dev:~$ cat /proc/sys/
128
adar@adar-dev:~$ cat inotify_test.c
#include <stdio.h>
#include <sys/inotify.h>
void main(int argc, char *argv[]) {
int err = inotify_init();
if (err == -1) {
perror(
}
}
adar@adar-dev:~$ gcc inotify_test.c -o inotify_test
adar@adar-dev:~$ ./inotify_test
inotify_init: Too many open files
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: amd64
ArecordDevices:
**** List of CAPTURE Hardware Devices ****
card 0: AudioPCI [Ensoniq AudioPCI], device 0: ES1371/1 [ES1371 DAC2/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Card0.Amixer.info:
Card hw:0 'AudioPCI'/'Ensoniq AudioPCI ENS1371 at 0x2040, irq 16'
Mixer name : 'Cirrus Logic CS4297A rev 3'
Components : 'AC97a:43525913'
Controls : 24
Simple ctrls : 13
DistroRelease: Ubuntu 12.04
HibernationDevice: RESUME=
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
IwConfig:
lo no wireless extensions.
eth0 no wireless extensions.
Lsusb:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
MachineType: VMware, Inc. VMware Virtual Platform
MarkForUpload: True
Package: linux (not installed)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcFB: 0 svgadrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.79.2
RfKill:
Tags: precise running-unity
Uname: Linux 3.2.0-36-generic x86_64
UpgradeStatus: Upgraded to precise on 2012-05-09 (254 days ago)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare wireshark
dmi.bios.date: 07/02/2012
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: 6.00
dmi.board.name: 440BX Desktop Reference Platform
dmi.board.vendor: Intel Corporation
dmi.board.version: None
dmi.chassis.
dmi.chassis.type: 1
dmi.chassis.vendor: No Enclosure
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: VMware Virtual Platform
dmi.product.
dmi.sys.vendor: VMware, Inc.
Changed in linux (Ubuntu Precise): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
Changed in linux (Ubuntu Quantal): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
Changed in linux (Ubuntu Precise): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
Changed in linux (Ubuntu Quantal): | |
assignee: | Joseph Salisbury (jsalisbury) → nobody |
tags: |
added: verification-done-precise removed: verification-needed-precise |
I should add that when I reboot the system, the problem goes away until I run my pyinotify unit tests again.