(not) Protecting of case IP_FW_GET.
Pawel Malachowski
pawmal-posting at freebsd.lublin.pl
Wed Aug 25 04:06:47 PDT 2004
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
More information about the freebsd-ipfw
mailing list