Bug 522945 - Endless loop in restorecond on 2.6.31
Summary: Endless loop in restorecond on 2.6.31
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-12 14:56 UTC by David Woodhouse
Modified: 2009-11-18 13:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-18 13:10:09 UTC


Attachments (Terms of Use)

Description David Woodhouse 2009-09-12 14:56:23 UTC
I built myself a 2.6.31 kernel to see if I could get my iwlwifi to work reliably.

When I boot it, restorecond goes into an endless loop...

inotify_add_watch(3, "/var/run/utmp", IN_MODIFY|IN_MOVED_FROM) = 9
open("/var/run/utmp", O_RDONLY)         = 4
fstat(4, {st_mode=S_IFREG|0664, st_size=7680, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa96af96000
read(4, "\2\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 3584
read(4, ""..., 4096)                    = 0
close(4)                                = 0
munmap(0x7fa96af96000, 4096)            = 0
inotify_rm_watch(3, 9)                  = 0
inotify_add_watch(3, "/var/run/utmp", IN_MODIFY|IN_MOVED_FROM) = 9
open("/var/run/utmp", O_RDONLY)         = 4
fstat(4, {st_mode=S_IFREG|0664, st_size=7680, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa96af96000
read(4, "\2\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 3584
read(4, ""..., 4096)                    = 0
close(4)                                = 0
munmap(0x7fa96af96000, 4096)            = 0
inotify_rm_watch(3, 9)                  = 0
inotify_add_watch(3, "/var/run/utmp", IN_MODIFY|IN_MOVED_FROM) = 9

Comment 1 Daniel Walsh 2009-09-14 15:53:44 UTC
Is the /var/run/utmp file being updated all the time?

Comment 2 David Woodhouse 2009-09-16 08:10:26 UTC
No.

[root@macbook dwmw2]# stat /var/run/utmp 
  File: `/var/run/utmp'
  Size: 10368     	Blocks: 24         IO Block: 4096   regular file
Device: 803h/2051d	Inode: 7954442     Links: 1
Access: (0664/-rw-rw-r--)  Uid: (    0/    root)   Gid: (   22/    utmp)
Access: 2009-09-15 21:54:02.000000000 +0100
Modify: 2009-09-15 21:54:01.000000000 +0100
Change: 2009-09-15 21:54:01.000000000 +0100
[root@macbook dwmw2]# strace -p 21569 2>&1 | head -20
Process 21569 attached - interrupt to quit
munmap(0x7f942c7da000, 4096)            = 0
inotify_rm_watch(3, 46)                 = 0
inotify_add_watch(3, "/var/run/utmp", IN_MODIFY|IN_MOVED_FROM) = 46
read(3, ".\0\0\0\0\200\0\0\0\0\0\0\0\0\0\0"..., 32768) = 16
open("/var/run/utmp", O_RDONLY)         = 4
fstat(4, {st_mode=S_IFREG|0664, st_size=10368, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f942c7da000
read(4, "\2\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 2176
read(4, ""..., 4096)                    = 0
close(4)                                = 0
munmap(0x7f942c7da000, 4096)            = 0
inotify_rm_watch(3, 46)                 = 0
inotify_add_watch(3, "/var/run/utmp", IN_MODIFY|IN_MOVED_FROM) = 46
read(3, ".\0\0\0\0\200\0\0\0\0\0\0\0\0\0\0"..., 32768) = 16
open("/var/run/utmp", O_RDONLY)         = 4
fstat(4, {st_mode=S_IFREG|0664, st_size=10368, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f942c7da000
[root@macbook dwmw2]# stat /var/run/utmp 
  File: `/var/run/utmp'
  Size: 10368     	Blocks: 24         IO Block: 4096   regular file
Device: 803h/2051d	Inode: 7954442     Links: 1
Access: (0664/-rw-rw-r--)  Uid: (    0/    root)   Gid: (   22/    utmp)
Access: 2009-09-15 21:54:02.000000000 +0100
Modify: 2009-09-15 21:54:01.000000000 +0100
Change: 2009-09-15 21:54:01.000000000 +0100

Comment 3 Daniel Walsh 2009-09-16 12:49:31 UTC
So the inotify must be fireing off constantly.

Comment 4 David Woodhouse 2009-09-16 13:37:42 UTC
A kernel bug, then? It only seems to be happening when I boot 2.6.31.

Comment 5 Daniel Walsh 2009-09-16 15:36:46 UTC
That is what I would figure.

Comment 6 Michal Schmidt 2009-09-24 21:49:27 UTC
Adding Eric Paris to CC, because it might be an inotify regression.

Comment 7 Eric Paris 2009-09-24 22:13:56 UTC
Restorecon problem.

http://marc.info/?l=selinux&m=125380417916233&w=2

inotify can now reuse watch descriptors which didn't happen in 2.6.30 or earlier.

Comment 8 Daniel Walsh 2009-09-25 03:15:16 UTC
Applied patch in policycoreutils-2.0.62-12.14.fc11


Note You need to log in before you can comment on or make changes to this bug.