linux/drivers/pinctrl/samsung
Krzysztof Kozlowski a0ee2ac039 pinctrl: samsung: Suppress unbinding to prevent theoretical attacks
Although unbinding a pinctrl driver requires root privileges but it
still might be used theoretically in certain attacks (by triggering NULL
pointer exception or memory corruption).

Samsung pincontrol drivers are essential for system operation so their
removal is not expected. They do not implement remove() driver callback
and they are not buildable as modules.

Suppression of the unbinding will prevent triggering NULL pointer
exception like this (Odroid XU3):

  $ echo 13400000.pinctrl > /sys/bus/platform/drivers/samsung-pinctrl/unbind
  $ cat /sys/kernel/debug/gpio

  Unable to handle kernel NULL pointer dereference at virtual address 00000c44
  pgd = ec41c000
  [00000c44] *pgd=6d448835, *pte=00000000, *ppte=00000000
  Internal error: Oops: 17 [#1] PREEMPT SMP ARM
    (samsung_gpio_get) from [<c034f9a0>] (gpiolib_seq_show+0x1b0/0x26c)
    (gpiolib_seq_show) from [<c01fb8c0>] (seq_read+0x304/0x4b8)
    (seq_read) from [<c02dbc78>] (full_proxy_read+0x4c/0x64)
    (full_proxy_read) from [<c01d9fb0>] (__vfs_read+0x2c/0x110)
    (__vfs_read) from [<c01db400>] (vfs_read+0x8c/0x110)
    (vfs_read) from [<c01db4c4>] (SyS_read+0x40/0x8c)
    (SyS_read) from [<c01078c0>] (ret_fast_syscall+0x0/0x3c)

Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-05-30 09:41:49 +02:00
..
Kconfig
Makefile
pinctrl-exynos.c GPIO bulk updates for the v4.5 kernel cycle: 2016-01-17 12:32:01 -08:00
pinctrl-exynos.h pinctrl: exynos: Add irq_chip instance for Exynos7 wakeup interrupts 2014-11-09 22:27:19 +09:00
pinctrl-exynos5440.c pinctrl: samsung: Suppress unbinding to prevent theoretical attacks 2016-05-30 09:41:49 +02:00
pinctrl-s3c24xx.c Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-18 08:11:42 -07:00
pinctrl-s3c64xx.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
pinctrl-samsung.c pinctrl: samsung: Suppress unbinding to prevent theoretical attacks 2016-05-30 09:41:49 +02:00
pinctrl-samsung.h pinctrl: exynos: add exynos5410 SoC specific data 2015-11-16 10:54:43 +09:00