Blame SOURCES/interrupts-Do-not-refrain-from-parsing-the-irq-affin.patch

c682bc
From 9361b771ad0b8fe1206469b89fc2eef9d13fe8b2 Mon Sep 17 00:00:00 2001
c682bc
From: Arnaldo Carvalho de Melo <acme@redhat.com>
c682bc
Date: Wed, 10 Jun 2015 19:44:20 -0300
c682bc
Subject: [PATCH 3/7] interrupts: Do not refrain from parsing the irq
c682bc
 affinities for !root
c682bc
c682bc
I.e. let the OS be the one to decide if access to this file is allowed
c682bc
or not, and non root users can see this, at least around 4.1-rc times:
c682bc
c682bc
Running: procfs/procfs.py:
c682bc
c682bc
  31: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [178564, 0, 285828, 0], 'users': ['xhci_hcd']}
c682bc
  30: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [342630, 0, 197229, 0], 'users': ['0000:00:1f.2']}
c682bc
  35: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [858, 0, 565, 0], 'users': ['snd_hda_intel']}
c682bc
  34: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [306, 0, 44, 0], 'users': ['thunderbolt']}
c682bc
c682bc
And now 'tuna -Q' works for non root users:
c682bc
c682bc
  [acme@zoo python-linux-procfs]$ ../tuna/tuna-cmd.py -Q
c682bc
     # users            affinity
c682bc
     0 timer             0,1,2,3
c682bc
     8 rtc0              0,1,2,3
c682bc
     9 acpi              0,1,2,3
c682bc
    17 17-fasteoi   brcmsmac  0,1,2,3
c682bc
    22 22-fasteoi   ehci_hcd:usb4  0,1,2,3
c682bc
    23 23-fasteoi   ehci_hcd:usb3  0,1,2,3
c682bc
    26 pciehp            0,1,2,3
c682bc
    27 pciehp            0,1,2,3
c682bc
    28 pciehp            0,1,2,3
c682bc
    29 pciehp            0,1,2,3
c682bc
    30 0000:00:1f.2      0,1,2,3
c682bc
    31 xhci_hcd          0,1,2,3
c682bc
    32 i915              0,1,2,3
c682bc
    33 mei_me            0,1,2,3
c682bc
    34 thunderbolt       0,1,2,3
c682bc
    35 snd_hda_intel     0,1,2,3
c682bc
  [acme@zoo python-linux-procfs]$
c682bc
c682bc
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
c682bc
Signed-off-by: John Kacur <jkacur@redhat.com>
c682bc
---
c682bc
 procfs/procfs.py | 2 --
c682bc
 1 file changed, 2 deletions(-)
c682bc
c682bc
diff --git a/procfs/procfs.py b/procfs/procfs.py
c682bc
index 4ff7e9804bc9..2d0e2b043797 100755
c682bc
--- a/procfs/procfs.py
c682bc
+++ b/procfs/procfs.py
c682bc
@@ -405,8 +405,6 @@ class interrupts:
c682bc
 		return dict
c682bc
 
c682bc
 	def parse_affinity(self, irq):
c682bc
-		if os.getuid() != 0:
c682bc
-			return
c682bc
 		try:
c682bc
 			f = file("/proc/irq/%s/smp_affinity" % irq)
c682bc
 			line = f.readline()
c682bc
-- 
c682bc
1.8.3.1
c682bc