mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
commit1689f25924upstream. 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:96518518cc("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit039ce5eb6b) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: I0f2d48b1246de2421edd7d566ae966f02ef63b54