kern/79806: [PATCH] ng_cisco(4) allocates too much memory.

Wojciech A. Koszek dunstan at freebsd.czest.pl
Mon Apr 11 16:50:23 PDT 2005


>Number:         79806
>Category:       kern
>Synopsis:       [PATCH] ng_cisco(4) allocates too much memory.
>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:   Mon Apr 11 23:50:23 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Wojciech A. Koszek
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD dunstan.freebsd.czest.pl 5.4-STABLE FreeBSD 5.4-STABLE #7: Tue Apr 12 00:11:29 CEST 2005 dunstan at dunstan.freebsd.czest.pl:/usr/obj/usr/src/sys/HOME8 i386

>Description:
ng_cisco(8) allocates too much memory for message. Macro NG_MKRESPONSE(rsp,
msg, len, how) allocates memory for "struct ng_mesg" itself. "len" is number
of bytes in rsp->data.
>How-To-Repeat:
cvs -d anoncvs at anoncvs.freebsd.org:/home/ncvs co -p
src/sys/netgraph/ng_cisco.c | head -267 | tail -10
>Fix:
Simple patch [diff.0.ng_cisco.c] which corrects this.

Index: src/sys/netgraph/ng_cisco.c
===================================================================
RCS file: /home/ncvs/src/sys/netgraph/ng_cisco.c,v
retrieving revision 1.27
diff -r1.27 ng_cisco.c
264,265c264
<                       NG_MKRESPONSE(resp, msg, sizeof(struct ng_mesg)
<                           + NG_TEXTRESPONSE, M_NOWAIT);
---
>                       NG_MKRESPONSE(resp, msg, NG_TEXTRESPONSE, M_NOWAIT);

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


More information about the freebsd-bugs mailing list