misc/118001: sysinstall can't read some packages from INDEX. (buffer overflow).

Lev Levinson llevinson at mail.ru
Mon Nov 12 05:30:01 PST 2007

>Number:         118001
>Category:       misc
>Synopsis:       sysinstall can't read some packages from INDEX. (buffer overflow).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 12 13:30:00 UTC 2007
>Originator:     Lev Levinson
>Release:        FreeBSD-7.0-BETA1
FreeBSD porky.dep24 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Wed Nov  7 13:45:40 MSK 2007     root at porky.dep24:/usr/src/sys/i386/compile/GENERIC_NODEBUG  i386
Sysinstall reads not-used fields of INDEX-file (especially "build dependencies") into buffer:

char junk[2048]    (see: src/usr.sbin/sysinstall/index.c:294,310)

But to-day big packages (like kde) has more then 2048 chars in that field.
As a result, buffer junk[] overflows and garbage appears in Packages menu of sysinstall.
cd /usr/ports
make fetchindex
mkdir -p /tmp/tttt/packages 
egrep "^kde" INDEX-7 > /tmp/tttt/packages/INDEX

In it menu select:
  Configure --> Packages --> File System --> enter path: "/tmp/tttt"
  look at garbage in menu "Package Selection".
Increase size of buffer junk[] at src/usr.sbin/sysinstall/index.c:294 from 2048 to 4096 (or 8192).


More information about the freebsd-bugs mailing list