1. 25 2月, 2020 19 次提交
  2. 24 2月, 2020 1 次提交
  3. 22 2月, 2020 11 次提交
  4. 21 2月, 2020 9 次提交
    • N
      net: netlink: cap max groups which will be considered in netlink_bind() · 3a20773b
      Nikolay Aleksandrov 提交于
      Since nl_groups is a u32 we can't bind more groups via ->bind
      (netlink_bind) call, but netlink has supported more groups via
      setsockopt() for a long time and thus nlk->ngroups could be over 32.
      Recently I added support for per-vlan notifications and increased the
      groups to 33 for NETLINK_ROUTE which exposed an old bug in the
      netlink_bind() code causing out-of-bounds access on archs where unsigned
      long is 32 bits via test_bit() on a local variable. Fix this by capping the
      maximum groups in netlink_bind() to BITS_PER_TYPE(u32), effectively
      capping them at 32 which is the minimum of allocated groups and the
      maximum groups which can be bound via netlink_bind().
      
      CC: Christophe Leroy <christophe.leroy@c-s.fr>
      CC: Richard Guy Briggs <rgb@redhat.com>
      Fixes: 4f520900 ("netlink: have netlink per-protocol bind function return an error code.")
      Reported-by: NErhard F. <erhard_f@mailbox.org>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a20773b
    • R
      net: disable BRIDGE_NETFILTER by default · 98bda63e
      Roman Kiryanov 提交于
      The description says 'If unsure, say N.' but
      the module is built as M by default (once
      the dependencies are satisfied).
      
      When the module is selected (Y or M), it enables
      NETFILTER_FAMILY_BRIDGE and SKB_EXTENSIONS
      which alter kernel internal structures.
      
      We (Android Studio Emulator) currently do not
      use this module and think this it is more consistent
      to have it disabled by default as opposite to
      disabling it explicitly to prevent enabling
      NETFILTER_FAMILY_BRIDGE and SKB_EXTENSIONS.
      Signed-off-by: NRoman Kiryanov <rkir@google.com>
      Acked-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98bda63e
    • J
      net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT · 2e92a2d0
      Julian Wiedmann 提交于
      Trivial cleanup, so that all bridge port-specific code can be found in
      one go.
      
      CC: Johannes Berg <johannes@sipsolutions.net>
      CC: Roopa Prabhu <roopa@cumulusnetworks.com>
      CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e92a2d0
    • I
      net: page_pool: API cleanup and comments · 458de8a9
      Ilias Apalodimas 提交于
      Functions starting with __ usually indicate those which are exported,
      but should not be called directly. Update some of those declared in the
      API and make it more readable.
      
      page_pool_unmap_page() and page_pool_release_page() were doing
      exactly the same thing calling __page_pool_clean_page().  Let's
      rename __page_pool_clean_page() to page_pool_release_page() and
      export it in order to show up on perf logs and get rid of
      page_pool_unmap_page().
      
      Finally rename __page_pool_put_page() to page_pool_put_page() since we
      can now directly call it from drivers and rename the existing
      page_pool_put_page() to page_pool_put_full_page() since they do the same
      thing but the latter is trying to sync the full DMA area.
      
      This patch also updates netsec, mvneta and stmmac drivers which use
      those functions.
      Suggested-by: NJonathan Lemon <jonathan.lemon@gmail.com>
      Acked-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Acked-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      458de8a9
    • L
      net: remove unused macro from fib_trie.c · 807ea870
      Li RongQing 提交于
      TNODE_KMALLOC_MAX and VERSION are not used, so remove them
      Signed-off-by: NLi RongQing <lirongqing@baidu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      807ea870
    • L
      net: neigh: remove unused NEIGH_SYSCTL_MS_JIFFIES_ENTRY · 94e512de
      Li RongQing 提交于
      this macro is never used, so remove it
      Signed-off-by: NLi RongQing <lirongqing@baidu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94e512de
    • K
      openvswitch: Distribute switch variables for initialization · 16a556ee
      Kees Cook 提交于
      Variables declared in a switch statement before any case statements
      cannot be automatically initialized with compiler instrumentation (as
      they are not part of any execution flow). With GCC's proposed automatic
      stack variable initialization feature, this triggers a warning (and they
      don't get initialized). Clang's automatic stack variable initialization
      (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
      doesn't initialize such variables[1]. Note that these warnings (or silent
      skipping) happen before the dead-store elimination optimization phase,
      so even when the automatic initializations are later elided in favor of
      direct initializations, the warnings remain.
      
      To avoid these problems, move such variables into the "case" where
      they're used or lift them up into the main function body.
      
      net/openvswitch/flow_netlink.c: In function ‘validate_set’:
      net/openvswitch/flow_netlink.c:2711:29: warning: statement will never be executed [-Wswitch-unreachable]
       2711 |  const struct ovs_key_ipv4 *ipv4_key;
            |                             ^~~~~~~~
      
      [1] https://bugs.llvm.org/show_bug.cgi?id=44916Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16a556ee
    • K
      net: ip6_gre: Distribute switch variables for initialization · 46d30cb1
      Kees Cook 提交于
      Variables declared in a switch statement before any case statements
      cannot be automatically initialized with compiler instrumentation (as
      they are not part of any execution flow). With GCC's proposed automatic
      stack variable initialization feature, this triggers a warning (and they
      don't get initialized). Clang's automatic stack variable initialization
      (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
      doesn't initialize such variables[1]. Note that these warnings (or silent
      skipping) happen before the dead-store elimination optimization phase,
      so even when the automatic initializations are later elided in favor of
      direct initializations, the warnings remain.
      
      To avoid these problems, move such variables into the "case" where
      they're used or lift them up into the main function body.
      
      net/ipv6/ip6_gre.c: In function ‘ip6gre_err’:
      net/ipv6/ip6_gre.c:440:32: warning: statement will never be executed [-Wswitch-unreachable]
        440 |   struct ipv6_tlv_tnl_enc_lim *tel;
            |                                ^~~
      
      net/ipv6/ip6_tunnel.c: In function ‘ip6_tnl_err’:
      net/ipv6/ip6_tunnel.c:520:32: warning: statement will never be executed [-Wswitch-unreachable]
        520 |   struct ipv6_tlv_tnl_enc_lim *tel;
            |                                ^~~
      
      [1] https://bugs.llvm.org/show_bug.cgi?id=44916Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46d30cb1
    • K
      net: core: Distribute switch variables for initialization · 161d1792
      Kees Cook 提交于
      Variables declared in a switch statement before any case statements
      cannot be automatically initialized with compiler instrumentation (as
      they are not part of any execution flow). With GCC's proposed automatic
      stack variable initialization feature, this triggers a warning (and they
      don't get initialized). Clang's automatic stack variable initialization
      (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
      doesn't initialize such variables[1]. Note that these warnings (or silent
      skipping) happen before the dead-store elimination optimization phase,
      so even when the automatic initializations are later elided in favor of
      direct initializations, the warnings remain.
      
      To avoid these problems, move such variables into the "case" where
      they're used or lift them up into the main function body.
      
      net/core/skbuff.c: In function ‘skb_checksum_setup_ip’:
      net/core/skbuff.c:4809:7: warning: statement will never be executed [-Wswitch-unreachable]
       4809 |   int err;
            |       ^~~
      
      [1] https://bugs.llvm.org/show_bug.cgi?id=44916Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      161d1792