[PATCH] Disable /dev/port interface on powerpc systems

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Apr 30 15:00:05 EST 2012


On Wed, 2012-03-21 at 18:23 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2012-03-20 at 22:37 -0700, Haren Myneni wrote:
> > Some power systems do not have legacy ISA devices. So, /dev/port is not
> > a valid interface on these systems. User level tools such as kbdrate is
> > trying to access the device using this interface which is causing the
> > system crash. 
> > 
> > This patch will fix this issue by not creating this interface on these
> > powerpc systems. 
> 
> Doesn't fix 32-bit... not a big deal for now I suppose... But I'd rather
> you change the patch a tiny bit to change legacy_isa_device_found() to
> arch_has_dev_port() instead. There may be other reason than legacy ISA
> to enable dev/port or not so let's make the arch hook more generic.
> 
> Another approach which might be even better is to filter per-access,
> ie for each read/write to /dev/port, have a hook to check if that
> specific port is valid, but that may be overkill for what is
> essentially a legacy interface that should have died a long time ago :)

The more I think about this the less I like it ...

At the end of the day, the bug is in kbdrate (or the distro, whatever)

It's just completely broken to have a bit of userspace running as root
randomly whacking IO ports or MMIO registers based on the assumption
that there must be some kind of ISA kbd controller there... It's going
to break on more than just powerpc (ARM anyone ?).

So kbdrate is busted and needs to be either fixed or removed.

Cheers,
Ben.




More information about the Linuxppc-dev mailing list