🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #13456

Re: 1.5 dumps core frequently

#13456
From: Ollivier Robert
Date: Fri, 20 Dec 1996 00:00
86 lines
4328 bytes
    [courtesy cc of this posting sent to cited author via email]

In article <ium916x2lzx.fsf@banzai.cc.columbia.edu>,
Justin Zaglio  <justin@columbia.edu> wrote:
> The master, however, has been unhappy.  Frequently innd will die and
> dump core with no messages anywhere about its reasons.  gdb'ing the
> dump shows that a bus error occurs in t_splay() of malloc(), called

Try this patch please after upgrading to 1.5.1...

From: shields@crosslink.net (Michael Shields)
Subject: Null pointer dereference in 1.5 (and 1.5.1)

Today the news servers on both my read machines started to die
repeatedly and simultaneously, logging nothing.  This happened once
two or three weeks ago when I wasn't around; at the time it cleared up
mysteriously after a while.

Today I finally tracked this down.  It was caused by an article with a
1060-character Path: header.  Because INN always writes out Path:
before Message-ID:, the receiving machines receive that header first
(and simultaneously since they're fed by nntplink), and ARTclean()
sees the too-long header it stops parsing before it learns the
Message-ID:.  Then, iff you have DO_REMEMBER_TRASH set, HISwrite gets
called to log the article, with a null pointer for the message-ID.
Boom.  Of course the reason that it died repeatedly is that the master
feed machine kept trying to resend it, and the reason that it clears
up eventually is that the backlog gets trimmed or the article expires
(it's a short-expire feed-only server).

I'm cc'ing this to inn-workers because it would actually be optimal if
trash were not remembered when an article is rejected for its path --
since that header is modified in transit, the article might arrive
again by another route that caused it to be acceptable.  This could
apply to the exclusions list also.

This could also be used as a denial-of-service attack.

Here's the patch.  This is against 1.5 but 1.5.1 looks like it has the
same bug.

Index: art.c
===================================================================
RCS file: /usr/src/master/inn/innd/art.c,v
retrieving revision 1.9
diff -u -r1.9 art.c
--- art.c	1996/12/12 00:39:01	1.9
+++ art.c	1996/12/18 03:41:30
@@ -1784,7 +1784,7 @@
 	(void)sprintf(buff, "%d %s", NNTP_REJECTIT_VAL, error);
 	ARTlog(&Data, ART_REJECT, buff);
 #if	defined(DO_REMEMBER_TRASH)
-        if (Mode == OMrunning && !HISwrite(&Data, ""))
+        if (Data.MessageID && Mode == OMrunning && !HISwrite(&Data, ""))
             syslog(L_ERROR, "%s cant write history %s %m",
                    LogName, Data.MessageID);
 #endif	/* defined(DO_REMEMBER_TRASH) */
@@ -1798,7 +1798,7 @@
         syslog(L_NOTICE, "rejecting[perl] %s %s", HDR(_message_id), buff);
         ARTlog(&Data, ART_REJECT, buff);
 #if	defined(DO_REMEMBER_TRASH)
-        if (Mode == OMrunning && !HISwrite(&Data, ""))
+        if (Data.MessageID && Mode == OMrunning && !HISwrite(&Data, ""))
             syslog(L_ERROR, "%s cant write history %s %m",
                    LogName, Data.MessageID);
 #endif	/* defined(DO_REMEMBER_TRASH) */
@@ -1842,7 +1842,7 @@
                        buff);
 		ARTlog(&Data, ART_REJECT, buff);
 #if	defined(DO_REMEMBER_TRASH)
-                if (Mode == OMrunning && !HISwrite(&Data, ""))
+                if (Data.MessageID && Mode == OMrunning && !HISwrite(&Data, ""))
                     syslog(L_ERROR, "%s cant write history %s %m",
                            LogName, Data.MessageID);
 #endif	/* defined(DO_REMEMBER_TRASH) */

-- 
Shields, CrossLink.


-- 
Ollivier ROBERT   -=- Eurocontrol EEC/TS -=-   Ollivier.Robert@eurocontrol.fr
Usenet Canal Historique

Technical Details
Message-ID: <59e9me$s8k$4@polaris.eurocontrol.fr>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <ium916x2lzx.fsf@banzai.cc.columbia.edu>

Show Full Headers
Complete Article Headers
Message-ID: <59e9me$s8k$4@polaris.eurocontrol.fr>
Subject: Re: 1.5 dumps core frequently
Date: Fri, 20 Dec 1996 00:00:00 +0000
From: Ollivier.Robert@eurocontrol.fr (Ollivier Robert)
References: <ium916x2lzx.fsf@banzai.cc.columbia.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 205105867
Distribution: inet
Organization: Eurocontrol EEC, Bretigny, France
Newsgroups: news.software.nntp
X-newsposter: Pnews 4.0-test50 (13 Dec 96)