Thread (9 messages) flat view 9 messages, 3 authors, 2023-07-06

Re: [PATCH net 1/6] netfilter: nf_tables: report use refcount overflow

From: Paolo Abeni <pabeni@redhat.com>
Date: 2023-07-06 09:01:51
Also in: netfilter-devel

On Thu, 2023-07-06 at 01:04 +0200, Pablo Neira Ayuso wrote:
Overflow use refcount checks are not complete.

Add helper function to deal with object reference counter tracking.
Report -EMFILE in case UINT_MAX is reached.

nft_use_dec() splats in case that reference counter underflows,
which should not ever happen.
For the records, I also once had the need for an non atomic reference
counters implementing sanity checks on underflows/overflows. I resorted
to use plain refcount_t, since the atomic op overhead was not
noticeable in my use-case.

[not blocking this series, just thinking aloud] I'm wondering if a
generic, non-atomic refcounter infra could be useful?

Cheers,

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help