Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 02:12:16 -0600
From:      Sean Kelly <smkelly@zombie.org>
To:        Nate Lawson <nate@root.org>
Cc:        current@freebsd.org
Subject:   Re: `cat /dev/io` leads to system lockup.
Message-ID:  <20021220081215.GA35355@edgemaster.zombie.org>
In-Reply-To: <Pine.BSF.4.21.0212192333210.61220-100000@root.org>
References:  <20021220062935.GA699@edgemaster.zombie.org> <Pine.BSF.4.21.0212192333210.61220-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 19, 2002 at 11:35:01PM -0800, Nate Lawson wrote:
> On Fri, 20 Dec 2002, Sean Kelly wrote:
> > On my 5.0-CURRENT kernel built 45 minutes ago, I can bring my system to=
 its
> > knees by doing
> >=20
> > # cat /dev/io
> >=20
> > While I understand that this isn't exactly something one would normally=
 be
> > doing, is it really something that should bring the system down?
>=20
> You're running as root.  So does "yes > /dev/da0" and "cat /dev/urandom >
> /dev/mem" and ... (infinity)

While I don't really care to test it, I wager that `yes >/dev/da0` will not
cause the system to lock hard. But you seem to be talking abot something
very different. You are talking about WRITING. I am talking about READING.

# cat /dev/da0
# cat /dev/urandom

None of these bring the system to its knees. So why does

# cat /dev/io

totally lock my system solid?

According to the manpage:
   The special file /dev/io is a controlled security hole that allows a pro-
   cess to gain I/O privileges (which are normally reserved for kernel-
   internal code).  Any process that holds a file descriptor on /dev/io open
   will get its IOPL bits in the flag register set, thus allowing it to per-
   form direct I/O operations. =20

This says nothing about what happens if you attempt to read() from /dev/io,
as `cat /dev/io` would be expected to do. At the least, there should be a
big, fat, blinking WARNING on the manpage telling you that `cat /dev/io` wi=
ll
bring your system down.

--=20
Sean Kelly         | PGP KeyID: D2E5E296
smkelly@zombie.org | http://www.zombie.org

--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+AtDfPm7A9NLl4pYRAoDzAJ4y3u/8ueWaibL9S3n6nxAkeozO9QCgzmHy
ygdiWHnsYrwhXuAp2hopams=
=wY4c
-----END PGP SIGNATURE-----

--sdtB3X0nJg68CQEu--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021220081215.GA35355>