Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2005 17:10:16 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Csaba Henk <csaba-ml@creo.hu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Easy DoS
Message-ID:  <20051216151016.GE84442@deviant.zoral.local>
In-Reply-To: <20051216133448.GA10382@beastie.creo.hu>
References:  <20051216133448.GA10382@beastie.creo.hu>

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

--WChQLJJJfbwij+9x
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 16, 2005 at 02:34:48PM +0100, Csaba Henk wrote:
> Do
>=20
> echo 'main() { write(1, 0, 1); }' > edos.c
> gcc -o edos edos.c
> ./edos | cat
>=20
> ... and now the edos process gets stuck in the write syscall, unkillably,
> keeping the CPU spinning. (Seen on my 6.0-RELEASE and 7.0-CURRENT boxen.)
>=20
> Is it a bug or a feature?
>=20
> Csaba

Sure, it is a bug :).

Please, try the following patch (against 7-CURRENT,
shall work for 6-STABLE too):

--- src-pristine/sys/kern/sys_pipe.c    Mon Jul 11 11:33:58 2005
+++ src-quotas/sys/kern/sys_pipe.c      Fri Dec 16 17:03:01 2005
@@ -1176,6 +1176,8 @@
                                        ("Pipe buffer overflow"));
                        }
                        pipeunlock(wpipe);
+                       if (error !=3D 0)
+                               break;
                } else {
                        /*
                         * If the "read-side" has been blocked, wake it up =
now.

Best regards,
Kostik Belousov

--WChQLJJJfbwij+9x
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFDotjWC3+MBN1Mb4gRAgmTAJ49URDjOy/WU9j4bZgx0iYUzSHz7gCdFDPB
huwhGk09BPeSoLV8FhzOS5s=
=6lBC
-----END PGP SIGNATURE-----

--WChQLJJJfbwij+9x--



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