linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: CONFIG_DEVPORT should not be used when PCI is being used
@ 2016-04-06 21:27 Al Stone
  2016-04-07  0:18 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Al Stone @ 2016-04-06 21:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: ahs3, Arnd Bergmann, Greg Kroah-Hartman

On arm64 systems, using /dev/port does not really make sense; this is
historically used for other architectures to access ISA IO ports, which
with any luck do not exist on arm64 platforms.  With the following snippet
of perl code (from Jeff Bastian <jbastian@redhat.com>), we can reliably
panic an arm64 system with PCI enabled:

	#!/usr/bin/perl -w
	# extracted from sensors-detect from lm_sensors
	# to reproduce kernel crash when probing the
	# Super-I/O ports
	use Fcntl qw(:DEFAULT :seek);
	sysopen(IOPORTS, "/dev/port", O_RDWR);
	binmode(IOPORTS);
	sysseek(IOPORTS, 0x2e, 0);
	syswrite(IOPORTS, pack("C", 0x0d), 1);

So, make sure CONFIG_DEVPORT cannot be set on arm64; it cannot really be
used and it allows us to crash a kernel from user space.

Signed-off-by: Al Stone <ahs3@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/char/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index b272397..c532f62 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -587,7 +587,7 @@ config TELCLOCK
 
 config DEVPORT
 	bool
-	depends on !M68K
+	depends on !M68K && !ARM64
 	depends on ISA || PCI
 	default y
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-12  5:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 21:27 [PATCH] arm64: CONFIG_DEVPORT should not be used when PCI is being used Al Stone
2016-04-07  0:18 ` Greg Kroah-Hartman
2016-04-07  7:26   ` Geert Uytterhoeven
2016-04-07 15:56     ` Al Stone
2016-04-09  2:21       ` Arnd Bergmann
2016-04-12  5:17       ` Jon Masters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).