Grsecurity vs vgaswitcheroo (hybrid-graphic laptop)
Posted: Sat Jun 28, 2014 11:41 am
I have a laptop with 2 graphic cards (intel + radeon). I am using vgaswitcheroo to disable radeon (which otherwise just pointlessly spins the laptops fan).
Unfortunatelly after patching the kernel with latest grsecurity patch, vgaswitcheroo doesn't work. I tried it over last weeks with few grsecurity and kernel versions (3.14.6, 3.14.8, 3.14.9, 3.15.1, 3.15.2). Result is always the same - after patching the kernel with grsecurity, vgaswitcheroo directory is no longer present in /sys/kernel/debug (debugfs is mounted).
There's also no mention about vgaswitcheroo in kern.log (When I boot vanilla kernel there is:
The thing is - it happens even if grsecurity is completly disabled in menuconfig. So it looks like the very fact of patching the kernel (even without enabling grsecurity in kernel's config) is causing this problem.
Here are some logs and informations about my system:
lspci
zgrep -i switcheroo /proc/config.gz
zgrep -i radeon /proc/config.gz
zgrep -i i915 /proc/config.gz
zgrep -i grkernsec /proc/config.gz
lsmod
eix radeon-ucode
mount | column -t | grep debugfs
ls -1F /sys/kernel/debug
Full config of 3.15.2-grsec (grsecurity disabled)
http://bpaste.net/show/417075/
diff of 3.15.2-vanilla config and 3.15.2-grsec config (grsecurity disabled):
kern.log - full boot procedure on 3.15.2-grsec
http://bpaste.net/show/417084/
Unfortunatelly after patching the kernel with latest grsecurity patch, vgaswitcheroo doesn't work. I tried it over last weeks with few grsecurity and kernel versions (3.14.6, 3.14.8, 3.14.9, 3.15.1, 3.15.2). Result is always the same - after patching the kernel with grsecurity, vgaswitcheroo directory is no longer present in /sys/kernel/debug (debugfs is mounted).
There's also no mention about vgaswitcheroo in kern.log (When I boot vanilla kernel there is:
- Code: Select all
VGA switcheroo: detected switching method \_SB_.PCI0.GFX0.ATPX handle
vga_switcheroo: enabled
The thing is - it happens even if grsecurity is completly disabled in menuconfig. So it looks like the very fact of patching the kernel (even without enabling grsecurity in kernel's config) is causing this problem.
Here are some logs and informations about my system:
lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM67 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6630M/6650M/6750M/7670M/7690M] (rev ff)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
09:00.0 Network controller: Intel Corporation Centrino Wireless-N 1030 [Rainbow Peak] (rev 34)
0b:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
zgrep -i switcheroo /proc/config.gz
- Code: Select all
CONFIG_VGA_SWITCHEROO=y
zgrep -i radeon /proc/config.gz
- Code: Select all
CONFIG_DRM_RADEON=m
# CONFIG_DRM_RADEON_UMS is not set
# CONFIG_FB_RADEON is not set
zgrep -i i915 /proc/config.gz
- Code: Select all
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
# CONFIG_SND_HDA_I915 is not set
zgrep -i grkernsec /proc/config.gz
- Code: Select all
# CONFIG_GRKERNSEC is not set
lsmod
- Code: Select all
Module Size Used by
i915 777108 2
snd_hda_codec_hdmi 37723 1
radeon 1349396 1
ttm 79755 1 radeon
snd_hda_codec_idt 49814 1
iwlwifi 88251 0
snd_hda_intel 34215 1
snd_hda_codec 159762 3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel
snd_hwdep 8418 1 snd_hda_codec
snd_pcm 108457 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_page_alloc 8918 2 snd_pcm,snd_hda_intel
snd_timer 26134 1 snd_pcm
snd 82743 9 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_idt,snd_pcm,snd_hda_codec,snd_hda_intel
x86_pkg_temp_thermal 5385 0
i2c_algo_bit 6289 2 i915,radeon
drm_kms_helper 38365 2 i915,radeon
drm 320845 6 ttm,i915,drm_kms_helper,radeon
fuse 94676 1
eix radeon-ucode
- Code: Select all
[I] x11-drivers/radeon-ucode
Available versions: 20140204 ~20140430
Installed versions: 20140204(02:29:39 02.06.2014)
Homepage: http://people.freedesktop.org/~agd5f/radeon_ucode/
Description: IRQ microcode for r6xx/r7xx/Evergreen/N.Islands/S.Islands Radeon GPUs and APUs
mount | column -t | grep debugfs
- Code: Select all
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
ls -1F /sys/kernel/debug
- Code: Select all
acpi
bdi
boot_params
dell_laptop
dma_buf
dri
extfrag
fault_around_order
hid
ieee80211
intel_powerclamp
kprobes
kvm
mce
mei
pkg_temp_thermal
sleep_time
tracing
usb
x86
Full config of 3.15.2-grsec (grsecurity disabled)
http://bpaste.net/show/417075/
diff of 3.15.2-vanilla config and 3.15.2-grsec config (grsecurity disabled):
--- VANILLA_CONFIG-3.15.2 2014-06-27 20:07:54.073310979 +0200
+++ GRSEC_DISABLED_CONFIG-3.15.2 2014-06-27 20:00:48.218386487 +0200
@@ -3018,7 +3018,7 @@
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_VMCORE=y
CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_PAGE_MONITOR is not set
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
@@ -3307,9 +3307,6 @@
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_EARLY_PRINTK_EFI is not set
# CONFIG_X86_PTDUMP is not set
-CONFIG_DEBUG_RODATA=y
-CONFIG_DEBUG_RODATA_TEST=y
-# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_DEBUG_NX_TEST is not set
CONFIG_DOUBLEFAULT=y
# CONFIG_DEBUG_TLBFLUSH is not set
@@ -3334,6 +3331,12 @@
#
# Security options
#
+
+#
+# Grsecurity
+#
+CONFIG_TASK_SIZE_MAX_SHIFT=47
+# CONFIG_GRKERNSEC is not set
CONFIG_KEYS=y
# CONFIG_PERSISTENT_KEYRINGS is not set
# CONFIG_BIG_KEYS is not set
kern.log - full boot procedure on 3.15.2-grsec
http://bpaste.net/show/417084/