]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r327718:
authorcy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 23 Jan 2018 04:01:48 +0000 (04:01 +0000)
committercy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 23 Jan 2018 04:01:48 +0000 (04:01 +0000)
commitadd8c50506bc01a582c20d2262bd3b31c87f4294
tree2116026977083395b012142450ad36c52cd8fd40
parent476a2c513afa8b749f543d6089c9caa11aadeb4e
MFC r327718:

When growing the state, also grow the seed array. Otherwise memory
that was not allocated will be accessed.

This necessitated refactoring state seed allocation from
ipf_state_soft_init() into a new common ipf_state_seed_alloc() function
as it is now also used by ipf_state_rehash() when changing the size of
the state hash table in addition to by ipf_state_soft_init() during
initialization.

According to Christos Zoulas <christos@NetBSD.org>:

The bug was encountered by a NetBSD vendor who's customer machines had
large ipfilter states. The bug was reliably triggered by resizing the
state variables using "ipf -T".

Submitted by: Christos Zoulas <christos@NetBSD.org>
Reviewed by: delphij, rgrimes
Obtained from: NetBSD ip_state.c CVS revs r1.9 and r1.10
Differential Revision: https://reviews.freebsd.org/D13755

git-svn-id: svn://svn.freebsd.org/base/stable/10@328274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/contrib/ipfilter/netinet/ip_state.c