i386/189955: makecontext(3) argument validation seems broken on i386 and powerpc

Peter Holm pho at freebsd.org
Mon May 19 16:10:01 UTC 2014


>Number:         189955
>Category:       i386
>Synopsis:       makecontext(3) argument validation seems broken on i386 and powerpc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 19 16:10:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Peter Holm
>Release:        11.0-CURRENT
>Organization:
>Environment:
FreeBSD x4.osted.lan 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r265724: Fri May  9 03:32:53 CEST 2014     pho at x4.osted.lan:/usr/src/sys/i386/compile/PHO  i386

>Description:
The argc validation seems broken:

$ grep -rw NCARGS /usr/include
/usr/include/sys/param.h:#define        NCARGS          ARG_MAX         /* max bytes for an exec function */
$ egrep "argc < 0.*argc" src/lib/libc/*/gen/makecontext.c              
src/lib/libc/amd64/gen/makecontext.c:   else if ((argc < 0) || (argc > 6) || (ucp->uc_stack.ss_sp == NULL) ||
src/lib/libc/i386/gen/makecontext.c:    else if ((argc < 0) || (argc > NCARGS)) {
src/lib/libc/ia64/gen/makecontext.c:    if (argc < 0 || argc > 8 || ucp == NULL ||
src/lib/libc/mips/gen/makecontext.c:    if (argc < 0 || argc > 6 || ucp == NULL ||
src/lib/libc/powerpc/gen/makecontext.c: if ((ucp == NULL) || (argc < 0) || (argc > NCARGS)
src/lib/libc/powerpc64/gen/makecontext.c:       if ((ucp == NULL) || (argc < 0) || (argc > NCARGS)
src/lib/libc/sparc64/gen/makecontext.c: if ((argc < 0) || (argc > 6) ||
$ 
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list