HomeFreeBSD

frag6: do not leak counter in error cases

Description

frag6: do not leak counter in error cases

When allocating the IPv6 fragement packet queue entry we do checks
against counters and if we pass we increment one of the counters
to claim the spot. Right after that we have two cases (malloc and MAC)
which can both fail in which case we free the entry but never released
our claim on the counter. In theory this can lead to not accepting new
fragments after a long time, especially if it would be MAC "refusing"
them.
Rather than immediately subtracting the value in the error case, only
increment it after these two cases so we can no longer leak it.

MFC after: 3 weeks
Sponsored by: Netflix

Details

Provenance
bzAuthored on
Parents
rS354080: superio_io.h: fix the copyright
Branches
Unknown
Tags
Unknown