Pablo Neira Ayuso 1689f25924 netfilter: nf_tables: report use refcount overflow
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.

Add nft_use_inc_restore() and nft_use_dec_restore() which are used
to restore reference counter from error and abort paths.

Use u32 in nft_flowtable and nft_object since helper functions cannot
work on bitfields.

Remove the few early incomplete checks now that the helper functions
are in place and used to check for refcount overflow.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2023-07-05 14:42:15 +02:00
..
2021-07-01 13:19:48 -07:00
2023-03-17 08:56:37 +00:00
2023-03-29 08:19:38 +01:00
2022-08-09 22:14:02 -07:00
2023-06-01 21:37:32 -07:00
2021-12-16 07:18:35 -08:00
2021-10-15 11:33:08 +01:00
2023-04-13 16:43:38 -07:00
2023-04-22 01:39:41 +02:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2022-05-11 12:43:10 +01:00
2023-05-11 18:07:05 -07:00
2021-08-03 13:05:26 +01:00
2023-02-16 09:27:07 +01:00
2022-12-12 15:04:39 -08:00
2023-03-07 09:33:43 -08:00
2023-04-13 16:43:38 -07:00