Panic in soqremque from sonewconn

Brian Thomson thomson at uthub.UUCP
Tue Feb 21 01:48:18 AEST 1984


You run out of mbufs because someone is using UNIX domain datagrams,
which are chock full o' bugs.  In this case, it is a misuse of
the sbappendaddr() routine that causes the trouble.

I have a list of 5 bugs in that stuff, and fixes for all of them.
If there is sufficient interest I will post my uipc_usrreq.c, but
there is always the possibility that Berkeley will eventually do it
with different semantics.

I would recommend that all 4.2BSD sites either fix this stuff or disable
it.  Otherwise you run the risk of panics, lost mbufs, orphaned file
descriptors, and improper reference counts when some curious user at
your site tries it out.  Disabling is easy.  In sys/uipc_usrreq.c,
routine unp_usrreq(), change the switch case:

	case PRU_ATTACH:
		if (unp) {
			error = EISCONN;
			break;
		}
		error = unp_attach(so);
		break;

to be:

	case PRU_ATTACH:
		if (unp) {
			error = EISCONN;
			break;
		} else if (so->so_type == SOCK_DGRAM) {
			/* Disabled because of a buggy implementation */
			error = ESOCKTNOSUPPORT;
			break;
		}
		error = unp_attach(so);
		break;


-- 
			Brian Thomson,	    CSRG Univ. of Toronto
			{linus,ihnp4,uw-beaver,floyd,utzoo}!utcsrgv!thomson



More information about the Comp.bugs.4bsd.ucb-fixes mailing list