Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755044AbcDGH0E (ORCPT ); Thu, 7 Apr 2016 03:26:04 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:32947 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784AbcDGH0C (ORCPT ); Thu, 7 Apr 2016 03:26:02 -0400 MIME-Version: 1.0 In-Reply-To: <20160407001819.GB9228@kroah.com> References: <1459978040-2226-1-git-send-email-ahs3@redhat.com> <20160407001819.GB9228@kroah.com> Date: Thu, 7 Apr 2016 09:26:00 +0200 X-Google-Sender-Auth: H4_29zjocp29l9RDDAWgxG0G0YY Message-ID: Subject: Re: [PATCH] arm64: CONFIG_DEVPORT should not be used when PCI is being used From: Geert Uytterhoeven To: Greg Kroah-Hartman Cc: Al Stone , "linux-kernel@vger.kernel.org" , Arnd Bergmann Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2272 Lines: 62 On Thu, Apr 7, 2016 at 2:18 AM, Greg Kroah-Hartman wrote: > On Wed, Apr 06, 2016 at 03:27:20PM -0600, Al Stone wrote: >> 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 ), 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); There are plenty of ways to crash a system as the root user... >> 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 >> Cc: Arnd Bergmann >> Cc: Greg Kroah-Hartman >> --- >> 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 > > Why not fix the real bug here, it's odd that only these two arches need > this disabled, don't you agree? In fact even the !M68K dependency is odd. The logic seems to originate from commit 153dcc54df826d2f ("[PATCH] mem driver: fix conditional on isa i/o support"), which accidentally changed an "||" into an "&&". Will send a patch later... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds