🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #20739

nnrpd crashing...

#20739
From: Edward S. Marshall
Date: Wed, 20 Aug 1997 00:00
58 lines
3138 bytes
Found a bug in article.c in INN 1.6b3. This is causing us much grief right
now, and may actually be due to a misconfiguration on our end, but the
problem is still there, regardless.

Basically, the symptom was that connecting clients were getting dumped in
the middle of transferring the headers of certain newsgroups (not all, and
the ones that caused trouble were usually groups with a large number of
unread articles). The problem turned out to be a segfault during execution
of XOVER.

Here's the gdb dump of what's happening:

#0  0xef63a77c in atol ()
#1  0x15124 in OVERfind (artnum=196701) at article.c:800
#2  0x16030 in CMDxover (ac=2, av=0x4d8d0) at article.c:1103
#3  0x1ce6c in main (argc=0, argv=0xeffffda4, env=0xeffffdac) at nnrpd.c:869

At line 800 in article.c, we find:

   800      for ( ; OVERarticle < artnum; OVERarticle = atol(OVERline))
   801          if ((OVERline = QIOread(OVERqp)) == NULL) {
   802              if (QIOtoolong(OVERqp))
   803                  continue;
   804              /* Don't close file; we may rewind. */
   805              return NULL;
   806          }

atol() will segfault (at least under Linux ans Solaris) when the argument
passed in is NULL; in this case, OVERline is getting set to NULL. Note,
just before we get to line 800:

   793      if (OVERarticle > artnum) {
   794          (void)QIOrewind(OVERqp);
   795          OVERlastarticle = 0;
   796          OVERarticle = 0;
   797          OVERline = NULL;
   798      }

Hence, OVERarticle is ending up greater than the current article number,
and we're getting to this code. And, since OVERarticle will be 0, it will
obviously be below artnum, so after the first iteration, the atol(NULL)
call will be made.

Now, the million-dollar question: have we simply misconfigured something,
such that the code in question is being reached due to a wierd condition
that noone expected? The code above would lead me to believe that this is
an accident waiting to happen, however.

-- 
                   ------------------------------------------------------------
Edward S. Marshall <emarshal@xnet.com>     _.-'        XNet Information Systems
http://www.xnet.com/~emarshal/         _.-'       Systems/Network Administrator
-----------------------------------------------------------
[  Are you a spammer looking for a great opportunity to be blacklisted? Then  ]
[ have your automatic bots email spam@logic.net and secure a spot on my list! ]

Technical Details
Message-ID: <5tfs2m$54d$2@flood.xnet.com>
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

Show Full Headers
Complete Article Headers
Message-ID: <5tfs2m$54d$2@flood.xnet.com>
Subject: nnrpd crashing...
Date: Wed, 20 Aug 1997 00:00:00 +0000
From: emarshal@logic.net (Edward S. Marshall)
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: 265573459
X-Complaints-To: news-admin@news.xnet.com
X-Trace: flood.xnet.com 872117142 5261 (None) 198.147.221.29
Organization: XNet Information Systems, Inc.
X-Spambait: spam@logic.net
Newsgroups: news.software.nntp