Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2005 23:50:18 GMT
From:      "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/79806: [PATCH] ng_cisco(4) allocates too much memory.
Message-ID:  <200504112350.j3BNoIQv030503@freebsd.czest.pl>
Resent-Message-ID: <200504112350.j3BNoNkG088187@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504112350.j3BNoIQv030503>