]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iflib: add assert to prevent out-of-bounds array access
authorVincenzo Maffione <vmaffione@FreeBSD.org>
Sun, 10 Jan 2021 13:49:51 +0000 (13:49 +0000)
committerVincenzo Maffione <vmaffione@FreeBSD.org>
Sun, 10 Jan 2021 13:59:20 +0000 (13:59 +0000)
commit4ba9ad0dc316940f32065b05f24259f942c0692d
tree5640d68e56209f2b3b77c7c80d5561813a2e35da
parent4f2cbaf3cd5900b06d3b5ad97db1962ec4fa0ffd
iflib: add assert to prevent out-of-bounds array access

The iflib_queues_alloc() allocates isc_nrxqs iflib_dma_info structs
for each rxqset, and links each struct to a different free list.
As a result, it must be isc_nrxqs >= isc_nfl (plus the completion
queue, if present).
Add an assertion to make this constraint explicit.

MFC after: 2 weeks
sys/net/iflib.c