Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2004 13:04:55 +0200
From:      Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To:        ipfw@freebsd.org
Subject:   (not) Protecting of case IP_FW_GET.
Message-ID:  <20040825110455.GB57463@shellma.zin.lublin.pl>

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

Let's look at netinet/ip_fw2.c, at ipfw_ctl(), case IP_FW_GET.
We are computing size of rules. Size can float because rules can be
dynamic.
In RELENG_4, it is protected with splimp().
In HEAD, it is not protected at all. Is this correct?
(Similar case in ip_dummynet, when computing size of pipes, is protected
with mutexes).

Another thing, in HEAD, there are three mallocs with M_WAITOK flag, only
one of them checks if malloc succeed (lookup tables code) and returns
ENOMEM, if not. Another two are assuming malloc will always succeed.
In RELENG_4, result is checked and ENOBUFS (why not ENOMEM?) is returned
if malloc failed.


-- 
Paweł Małachowski



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