1e6769554SRui Paulo.\" 2e6769554SRui Paulo.\" Copyright (c) 1996 Joerg Wunsch 3e6769554SRui Paulo.\" 4e6769554SRui Paulo.\" All rights reserved. 5e6769554SRui Paulo.\" 6e6769554SRui Paulo.\" This program is free software. 7e6769554SRui Paulo.\" 8e6769554SRui Paulo.\" Redistribution and use in source and binary forms, with or without 9e6769554SRui Paulo.\" modification, are permitted provided that the following conditions 10e6769554SRui Paulo.\" are met: 11e6769554SRui Paulo.\" 1. Redistributions of source code must retain the above copyright 12e6769554SRui Paulo.\" notice, this list of conditions and the following disclaimer. 13e6769554SRui Paulo.\" 2. Redistributions in binary form must reproduce the above copyright 14e6769554SRui Paulo.\" notice, this list of conditions and the following disclaimer in the 15e6769554SRui Paulo.\" documentation and/or other materials provided with the distribution. 16e6769554SRui Paulo.\" 17e6769554SRui Paulo.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 18e6769554SRui Paulo.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19e6769554SRui Paulo.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20e6769554SRui Paulo.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 21e6769554SRui Paulo.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22e6769554SRui Paulo.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23e6769554SRui Paulo.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24e6769554SRui Paulo.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25e6769554SRui Paulo.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26e6769554SRui Paulo.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27e6769554SRui Paulo.\" 28e6769554SRui Paulo.\" $FreeBSD$ 29e6769554SRui Paulo.\" 30c383d55bSGavin Atkinson.Dd February 8, 2010 31c383d55bSGavin Atkinson.Dt IO 4 32e6769554SRui Paulo.Os 33e6769554SRui Paulo.Sh NAME 34e6769554SRui Paulo.Nm io 35e6769554SRui Paulo.Nd I/O privilege file 36e6769554SRui Paulo.Sh SYNOPSIS 37e6769554SRui Paulo.Cd "device io" 38e6769554SRui Paulo.Sh DESCRIPTION 39e6769554SRui PauloThe special file 40e6769554SRui Paulo.Pa /dev/io 41e6769554SRui Paulois a controlled security hole that allows a process to gain I/O 42e6769554SRui Pauloprivileges 43e6769554SRui Paulo(which are normally reserved for kernel-internal code). 44e6769554SRui PauloAny process that holds a file descriptor on 45e6769554SRui Paulo.Pa /dev/io 46e6769554SRui Pauloopen will get its 47e6769554SRui Paulo.Em IOPL 48e6769554SRui Paulobits in the flag register set, thus allowing it to perform direct 49e6769554SRui PauloI/O operations. 50e6769554SRui PauloThis can be useful in order to write userland 51e6769554SRui Pauloprograms that handle some hardware directly. 52e6769554SRui PauloNote that even read-only access will grant the full I/O privileges. 53e6769554SRui Paulo.Pp 54e6769554SRui PauloIn addition to any file access permissions on 55e6769554SRui Paulo.Pa /dev/io , 56e6769554SRui Paulothe kernel enforces that only the super-user may open this device. 57e6769554SRui Paulo.Sh FILES 58e6769554SRui Paulo.Bl -tag -width Pa -compact 59e6769554SRui Paulo.It Pa /dev/io 60e6769554SRui Paulo.El 61e6769554SRui Paulo.Sh SEE ALSO 62e6769554SRui Paulo.Xr i386_get_ioperm 2 , 63e6769554SRui Paulo.Xr i386_set_ioperm 2 , 64e6769554SRui Paulo.Xr mem 4 65e6769554SRui Paulo.Sh HISTORY 66e6769554SRui PauloThe 67e6769554SRui Paulo.Nm 68e6769554SRui Paulofile appeared in 69e6769554SRui Paulo.Fx 1.0 . 70