Commit b00726e0 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Treehugger Robot
Browse files

UPSTREAM: netfilter: nf_tables: report use refcount overflow



commit 1689f259 upstream.

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.

Bug: 302085977
Fixes: 96518518 ("netfilter: add nftables")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 039ce5eb)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Iae545c52ae83bc398718867a4e944369e099ae95
parent e99dd1ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment