1. 01 Dec, 2022 3 commits
  2. 30 Nov, 2022 2 commits
    • Pablo Neira Ayuso's avatar
      netfilter: ctnetlink: fix compilation warning after data race fixes in ct mark · 1feeae07
      Pablo Neira Ayuso authored
      All warnings (new ones prefixed by >>):
      
         net/netfilter/nf_conntrack_netlink.c: In function '__ctnetlink_glue_build':
      >> net/netfilter/nf_conntrack_netlink.c:2674:13: warning: unused variable 'mark' [-Wunused-variable]
          2674 |         u32 mark;
               |             ^~~~
      
      Fixes: 52d1aa8b ("netfilter: conntrack: Fix data-races around ct mark")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Tested-by: default avatarIvan Babrou <ivan@ivan.computer>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      1feeae07
    • Xin Long's avatar
      netfilter: conntrack: fix using __this_cpu_add in preemptible · 9464d0b6
      Xin Long authored
      Currently in nf_conntrack_hash_check_insert(), when it fails in
      nf_ct_ext_valid_pre/post(), NF_CT_STAT_INC() will be called in the
      preemptible context, a call trace can be triggered:
      
         BUG: using __this_cpu_add() in preemptible [00000000] code: conntrack/1636
         caller is nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack]
         Call Trace:
          <TASK>
          dump_stack_lvl+0x33/0x46
          check_preemption_disabled+0xc3/0xf0
          nf_conntrack_hash_check_insert+0x45/0x430 [nf_conntrack]
          ctnetlink_create_conntrack+0x3cd/0x4e0 [nf_conntrack_netlink]
          ctnetlink_new_conntrack+0x1c0/0x450 [nf_conntrack_netlink]
          nfnetlink_rcv_msg+0x277/0x2f0 [nfnetlink]
          netlink_rcv_skb+0x50/0x100
          nfnetlink_rcv+0x65/0x144 [nfnetlink]
          netlink_unicast+0x1ae/0x290
          netlink_sendmsg+0x257/0x4f0
          sock_sendmsg+0x5f/0x70
      
      This patch is to fix it by changing to use NF_CT_STAT_INC_ATOMIC() for
      nf_ct_ext_valid_pre/post() check in nf_conntrack_hash_check_insert(),
      as well as nf_ct_ext_valid_post() in __nf_conntrack_confirm().
      
      Note that nf_ct_ext_valid_pre() check in __nf_conntrack_confirm() is
      safe to use NF_CT_STAT_INC(), as it's under local_bh_disable().
      
      Fixes: c56716c6 ("netfilter: extensions: introduce extension genid count")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      9464d0b6
  3. 29 Nov, 2022 21 commits
  4. 28 Nov, 2022 14 commits