Date: Thu, 22 Mar 2001 07:09:15 -0800 (PST) From: andrew@nfr.net To: freebsd-gnats-submit@FreeBSD.org Subject: kern/26000: unchecked return in vm/swap_pager.c Message-ID: <200103221509.f2MF9Fm35630@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 26000
>Category: kern
>Synopsis: unchecked return in vm/swap_pager.c
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Mar 22 07:10:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Andrew Lambeth
>Release: 4.1 and 4.2
>Organization:
NFR Security
>Environment:
FreeBSD better.andrew.creep.net 4.1-RELEASE FreeBSD 4.1-RELEASE #0: Thu Feb 22 10:10:45 EST 2001 andrew@better.andrew.creep.net:/usr/src/sys/compile/BETTER i386
>Description:
There is an unchecked return from zinit() at line 307 in vm/swap_pager.c
this call will return NULL if kmem malloc limits have been increased beyond
a certain point (~800MB) by modifying the algorithm or limits in kmeminit().
It is unlikely that anyone would experience this in any normal situation,
still it seems like there should be a panic there.
>How-To-Repeat:
Increase kmem malloc limits to >800MB and boot the kernel. It will run
fine until the first time it tries to page out, and then crash by
dereferencing the NULL pointer swap_zone.
>Fix:
Index: swap_pager.c
===================================================================
RCS file: /big/cvs/freebsd_sys_41/vm/swap_pager.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -r1.1.1.1 -r1.1.1.1.2.1
314a315,318
> if(swap_zone == NULL) {
> panic("swap_zone == NULL");
> }
>
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103221509.f2MF9Fm35630>
