[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] MiNTNet "land" bug fixed



Hello MiNTers,

It was brought to my attention that MiNTNet can be crashed remotely via
the use of a widely distributed program called "land," which works by
sending a TCP datagram with the same source and destination address. When
this program is used, a machine running MiNTNet will freeze, i.e. it will
no longer respond to any user input.

I have implemented a hack which avoids this problem. Incoming TCP
datagrams which meet the following conditions are silently discarded: the
TCP datagram is addressed to a LISTEN socket, the source and destination
addresses are equal and the source and destination ports are equal. I
believe the above conditions never occur during normal operation of TCP,
and this the hack will only affect TCP datagrams generated by the "land"
program, which will be discarded.

The file that needs altering is net/inet/tcp.c in the MiNTNet 1.03 source
code, and the diff from the original MiNTNet 1.03 version of tcp.c is as
follows.

770a771,780
> 	
> 	/* BEGIN MARIO BECROFT'S STUPID LAND BUG HACK */
> 	if (tcb->state == TCBS_LISTEN && saddr == daddr && tcph->srcport == tcph->dstport)
> 	{
> 		DEBUG (("tcp_input: MARIO BECROFT'S STUPID LAND BUG HACK"));
> 		buf_deref (buf, BUF_NORMAL);
> 		return 0;
> 	}
> 	/* END MARIO BECROFT'S STUPID LAND BUG HACK */
> 	

You can also download a sockdev.xdd binary with this patch applied from my
WWW site which is at the following URL (if my ISP hasn't moved it again):

http://www.ak.planet.gen.nz/~mario/

Having discovered that this network business is not as difficult as I
thought it was, I decided to also do some more work on MiNTNet. I am
currently working on adding IP masquerading to MiNTNet, whereby several
machines can connect to a network even if they do not have officially
assigned IP addresses on the network.

However until about 2 days ago, I knew virtually nothing about the
subject, and although I have done a lot of reading since that time, that
doesn't make me an expert over night. So no doubt I will make many silly
mistakes and development will not proceed as quickly as if a knowledgable
person was attempting it. Nevertheless I have already figured out
generally how MiNTNet works, and I have made some progress without
reaching any insurmountable obstacles, so it looks promising so far.

Who is the current MiNTNet maintainer? Is anyone else working on MiNTNet?
I would like to talk to anyone else who is doing work on MiNTNet so that
we can avoid duplication of effort and optimise the future development of
MiNTNet.

-- 
+-----------------------------------------------------------------------+
| Mario Becroft                * Tariland, New Zealand Atari User Group |
| mb@tos.pl.net                * Atari Hardware Developments            |
| http://www.ak.planet.gen.nz/~mario/ * Atari Serial Mouse Interface    |
+-----------------------------------------------------------------------+