[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c98394f6d399b4e725521f8d9fe9788f7fe3784.camel@redhat.com>
Date: Thu, 06 Jul 2023 11:01:42 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Pablo Neira Ayuso <pablo@...filter.org>, netfilter-devel@...r.kernel.org
Cc: davem@...emloft.net, netdev@...r.kernel.org, kuba@...nel.org,
edumazet@...gle.com
Subject: Re: [PATCH net 1/6] netfilter: nf_tables: report use refcount
overflow
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
Powered by blists - more mailing lists