element expiration can be read-write locklessly, it can be written by
dynset and read from netlink dump, add annotation.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
u64 tstamp)
{
return nft_set_ext_exists(ext, NFT_SET_EXT_EXPIRATION) &&
- time_after_eq64(tstamp, *nft_set_ext_expiration(ext));
+ time_after_eq64(tstamp, READ_ONCE(*nft_set_ext_expiration(ext)));
}
static inline bool nft_set_elem_expired(const struct nft_set_ext *ext)
if (nft_set_ext_exists(ext, NFT_SET_EXT_EXPIRATION)) {
u64 expires, now = get_jiffies_64();
- expires = *nft_set_ext_expiration(ext);
+ expires = READ_ONCE(*nft_set_ext_expiration(ext));
if (time_before64(now, expires))
expires -= now;
else
if (priv->op == NFT_DYNSET_OP_UPDATE &&
nft_set_ext_exists(ext, NFT_SET_EXT_EXPIRATION)) {
timeout = priv->timeout ? : READ_ONCE(set->timeout);
- *nft_set_ext_expiration(ext) = get_jiffies_64() + timeout;
+ WRITE_ONCE(*nft_set_ext_expiration(ext), get_jiffies_64() + timeout);
}
nft_set_elem_update_expr(ext, regs, pkt);