bin/148733: a potential buffer overflow in bin/sh

Changming Sun snnn119 at gmail.com
Sun Jul 18 15:20:06 UTC 2010


>Number:         148733
>Category:       bin
>Synopsis:       a potential buffer overflow  in bin/sh
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 18 15:20:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Changming Sun
>Release:        FreeBSD 9
>Organization:
wanmei.inc
>Environment:
FreeBSD 9
>Description:
There is a invoke to "readdir" function in /usr/src/bin/sh/expand.c:expmeta(char *enddir, char *name),then the result of d_name has been copied to "enddir"  scopy(dp->d_name, enddir);

is enddir enough large to hold this ?

expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */

It seems like somebody has already known this problem,but nobody want to fix it!
>How-To-Repeat:
Get head source from svn,then review it.
>Fix:


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


More information about the freebsd-bugs mailing list