Article View: news.software.nntp
Article #19947Comparing 1.5.1, 1.5.1sec, 1.6b2
From: Forrest J. Cavalier III
Date: Thu, 31 Jul 1997 00:00
Date: Thu, 31 Jul 1997 00:00
146 lines
5562 bytes
5562 bytes
I am still working on sorting it all out. But with the reports
of yet more bugs, I thought I should make some private work
more public so that others can help find the cause of recent
reports of core dumps in 1.5.1sec
I have created unified sources of 1.5.1, 1.5.1sec and 1.6b2.
http://www.mibsoftware.com/userkt/inn/unified97/innd/
(Right now only the innd subdirectory is finished.)
The files in that directory are in an experimental mark-up format
which allows easy comparison of all three versions.
Here is an example of code in the mibexp markup format, which
shows how the unified format allows easy comparison. (This is
from innd.c)
-- Begin Example ---
#mibexp#ifexp INN1P6BS XINN1P6B2
Path.Data = NEW(char, Path.Used + 1);
(void)snprintf(Path.Data, Path.Used + 1, "%s!", path);
#mibexp#elifexp XINN151SEC
Path.Used = strlen (path) + 1 ;
Path.Size = Path.Used + 1 ;
Path.Data = NEW(char, Path.Size);
(void)snprintf(Path.Data, Path.Size, "%s!", path);
#mibexp#elseexp
Path.Data = NEW(char, Path.Used + 1);
(void)sprintf(Path.Data, "%s!", path);
#mibexp#endexp 770
/* Get the Xref prefix. */
Xref.Size = STRLEN("Xref: ") + strlen(path) + 1;
Xref.Data = NEW(char, Xref.Size);
-- End Example ---
The mark-up is similar to C #if/#endif conditionals, and it
is described in more detail below.
Outline of Planned work
- - - - - - - - - - - -
I am going through each mibexp and change each control into
one of the following categories:
INN151SL, INN160SL
String limit overrun patches. Actual bugs, which
should be patched.
Some may be impossible to trigger without truly bizarre
config.data setups. (Such as when strlen(CTRLBIN)+
strlen(_PATH_BADCONTROLPROG) > 256)
Most are not external threats. (I.e. only local config.data
or programming (perl filters) could cause the overrun.
There is at least one instance of passing strerror() as a %s
argument to sprintf. This was changed in 1.5.1sec to
use sprintf() I don't know that this should count, but I
put it in this category also.
Perhaps this category should be split, with using XS for
those cases where external data is being processed.
INN151BS, INN160BS
Belt and Suspenders patches: string limit patches which
were not necessary. (The limit was already considered
when sizing buffers, etc.)
INN151CC, INN160CC
Change in comments. Documentation change, fix, etc with
NO executable code change.
INN1P6FE,
Feature enhancement, operational change
INN151DF, INN160CC
Other Defect Fix
INN160SD, INN151SD
Unnecessary String limit patch attempts which are defective.
(All the ones I reported to James got fixed before 1.5.1sec
went public.)
I suspect that recent reports of core dumping by INN1.5.1sec innd
are from one of two sources:
1. A newly introduced defect. (Of particular interest are the
cases where 1.5.1sec and 1.6b2 do not agree.)
2. An uncovered latent defect. (Exposed due to changed use
of malloc() subsystem, etc.)
In either case, the unified format makes inspecting code changes
much easier. I think the safest course of action is to isolate
ONLY the NECESSARY string limit and defect changes to protect against
external attacks. I think this is a very small subset of all the
changes. This should be 1.5.1sec.
The long-term course of action is to re-engineer INN with limitless
strings. Right now, the 1.5.1sec "solution" is to truncate strings.
I disagree with this method, especially in functions like the
new FileGlue() (innd/innd.c) which truncate strings silently. This
is not the behavior you want when you are building a path to
files and executables.
I had hoped to have it all sorted out by now. But I got side-tracked
in creating the experimental versions of the tools to support the
output format. The output of GNU diff -D was useful in comparing only
two versions, which was not adequate for this work.. It took time to create
the necessary tools. (Did I just re-invent some wheel?)
Apologies for the brief description and "unpolished" look to everything.
Having more people inspect makes it more likely to find defects
sooner.
Questions & comments welcomed.
Forrest Cavalier, Mib Software, INN customization and consulting
Further explanation of the mibexp markup format.
- - - - - - - - - - - - - - - - - - - - - - - -
1. Syntax:
#mibexp#ifexp CONTROL [CONTROL2...]
#mibexp#elifexp CONTROL [CONTROL2...]
#mibexp#elseexp
#mibexp#endexp N
Where N is the line number of the base version: in this case
the 1.5.1 version.
2. The else clause is always the base version.
3. Processing occurs BEFORE comments or other conditionals
are interpreted.
4. mibexp directives may not be nested.
I have tools for creating and manipulating mibexp files, but
they are still experimental. (I.e. not fully tested.)
Technical Details
Message-ID:
<5rp1ig$asn$1@news1.epix.net>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-mailShow Full Headers
Complete Article Headers
Message-ID: <5rp1ig$asn$1@news1.epix.net> Subject: Comparing 1.5.1, 1.5.1sec, 1.6b2 Date: Thu, 31 Jul 1997 00:00:00 +0000 From: mibsoft@epix.net (Forrest J. Cavalier III) 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: 260804738 Organization: Mib Software Newsgroups: news.software.nntp