All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 0/3] netfilter: nf_tables: reject loads from uninitialized registers
@ 2023-05-05 11:16 Florian Westphal
  2023-05-05 11:16 ` [PATCH nf-next 1/3] netfilter: nf_tables: pass context structure to nft_parse_register_load Florian Westphal
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Florian Westphal @ 2023-05-05 11:16 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

Keep a per-rule bitmask that tracks registers that have seen a store,
then reject loads when the accessed registers haven't been flagged.

This changes uabi contract, because we previously allowed this.
Neither nftables nor iptables-nft create such rules.

In case there is breakage, we could insert an 'store 0 to x'
immediate expression into the ruleset automatically, but this
isn't done here.

Let me know if you think the "refuse" approach is too risky.

Florian Westphal (3):
  netfilter: nf_tables: pass context structure to
    nft_parse_register_load
  netfilter: nf_tables: validate register loads never access unitialised
    registers
  netfilter: nf_tables: don't initialize registers in nft_do_chain()

 include/net/netfilter/nf_tables.h      |  4 ++-
 net/bridge/netfilter/nft_meta_bridge.c |  2 +-
 net/ipv4/netfilter/nft_dup_ipv4.c      |  4 +--
 net/ipv6/netfilter/nft_dup_ipv6.c      |  4 +--
 net/netfilter/nf_tables_api.c          | 40 +++++++++++++++++++++++---
 net/netfilter/nf_tables_core.c         |  2 +-
 net/netfilter/nft_bitwise.c            |  4 +--
 net/netfilter/nft_byteorder.c          |  2 +-
 net/netfilter/nft_cmp.c                |  6 ++--
 net/netfilter/nft_ct.c                 |  2 +-
 net/netfilter/nft_dup_netdev.c         |  2 +-
 net/netfilter/nft_dynset.c             |  4 +--
 net/netfilter/nft_exthdr.c             |  2 +-
 net/netfilter/nft_fwd_netdev.c         |  6 ++--
 net/netfilter/nft_hash.c               |  2 +-
 net/netfilter/nft_lookup.c             |  2 +-
 net/netfilter/nft_masq.c               |  4 +--
 net/netfilter/nft_meta.c               |  2 +-
 net/netfilter/nft_nat.c                |  8 +++---
 net/netfilter/nft_objref.c             |  2 +-
 net/netfilter/nft_payload.c            |  2 +-
 net/netfilter/nft_queue.c              |  2 +-
 net/netfilter/nft_range.c              |  2 +-
 net/netfilter/nft_redir.c              |  4 +--
 net/netfilter/nft_tproxy.c             |  4 +--
 25 files changed, 76 insertions(+), 42 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-05-31  9:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05 11:16 [PATCH nf-next 0/3] netfilter: nf_tables: reject loads from uninitialized registers Florian Westphal
2023-05-05 11:16 ` [PATCH nf-next 1/3] netfilter: nf_tables: pass context structure to nft_parse_register_load Florian Westphal
2023-05-05 11:16 ` [PATCH nf-next 2/3] netfilter: nf_tables: validate register loads never access unitialised registers Florian Westphal
2023-05-30 23:49   ` Pablo Neira Ayuso
2023-05-31  9:51     ` Florian Westphal
2023-05-05 11:16 ` [PATCH nf-next 3/3] netfilter: nf_tables: don't initialize registers in nft_do_chain() Florian Westphal
2023-05-05 13:16 ` [PATCH nf-next 0/3] netfilter: nf_tables: reject loads from uninitialized registers Phil Sutter
2023-05-05 13:46   ` Florian Westphal
2023-05-05 14:14     ` Phil Sutter
2023-05-05 14:32 ` Pablo Neira Ayuso
2023-05-05 14:51   ` Florian Westphal
2023-05-05 15:34     ` Pablo Neira Ayuso
2023-05-07 11:22       ` Florian Westphal
2023-05-10  7:56         ` Pablo Neira Ayuso
2023-05-10  8:06           ` Florian Westphal
2023-05-10 15:46             ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.