1. 15 9月, 2020 16 次提交
  2. 14 9月, 2020 4 次提交
    • D
      rxrpc: Fix an overget of the conn bundle when setting up a client conn · f1b44974
      David Howells 提交于
      When setting up a client connection, a second ref is accidentally obtained
      on the connection bundle (we get one when allocating the conn and a second
      one when adding the conn to the bundle).
      
      Fix it to only use the ref obtained by rxrpc_alloc_client_connection() and
      not to add a second when adding the candidate conn to the bundle.
      
      Fixes: 245500d8 ("rxrpc: Rewrite the client connection manager")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      f1b44974
    • D
      rxrpc: Fix conn bundle leak in net-namespace exit · 546a4241
      David Howells 提交于
      When the network namespace exits, rxrpc_clean_up_local_conns() needs to
      unbundle each client connection it evicts.  Fix it to do this.
      
      kernel BUG at net/rxrpc/conn_object.c:481!
      RIP: 0010:rxrpc_destroy_all_connections.cold+0x11/0x13 net/rxrpc/conn_object.c:481
      Call Trace:
       rxrpc_exit_net+0x1a4/0x2e0 net/rxrpc/net_ns.c:119
       ops_exit_list+0xb0/0x160 net/core/net_namespace.c:186
       cleanup_net+0x4ea/0xa00 net/core/net_namespace.c:603
       process_one_work+0x94c/0x1670 kernel/workqueue.c:2269
       worker_thread+0x64c/0x1120 kernel/workqueue.c:2415
       kthread+0x3b5/0x4a0 kernel/kthread.c:292
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
      
      Fixes: 245500d8 ("rxrpc: Rewrite the client connection manager")
      Reported-by: syzbot+52071f826a617b9c76ed@syzkaller.appspotmail.com
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      546a4241
    • D
      rxrpc: Fix rxrpc_bundle::alloc_error to be signed · 8806245a
      David Howells 提交于
      The alloc_error field in the rxrpc_bundle struct should be signed as it has
      negative error codes assigned to it.  Checks directly on it may then fail,
      and may produce a warning like this:
      
      	net/rxrpc/conn_client.c:662 rxrpc_wait_for_channel()
      	warn: 'bundle->alloc_error' is unsigned
      
      Fixes: 245500d8 ("rxrpc: Rewrite the client connection manager")
      Reported-by Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      8806245a
    • D
      rxrpc: Fix an error goto in rxrpc_connect_call() · 456b2f2d
      David Howells 提交于
      Fix an error-handling goto in rxrpc_connect_call() whereby it will jump to
      free the bundle it failed to allocate.
      
      Fixes: 245500d8 ("rxrpc: Rewrite the client connection manager")
      Reported-by: Nkernel test robot <lkp@intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      456b2f2d
  3. 12 9月, 2020 5 次提交
    • V
      Revert "net: dsa: Add more convenient functions for installing port VLANs" · 88236591
      Vladimir Oltean 提交于
      This reverts commit 314f76d7.
      
      Citing that commit message, the call graph was:
      
          dsa_slave_vlan_rx_add_vid   dsa_port_setup_8021q_tagging
                      |                        |
                      |                        |
                      |          +-------------+
                      |          |
                      v          v
                     dsa_port_vid_add      dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      
      Now that tag_8021q has its own ops structure, it no longer relies on
      dsa_port_vid_add, and therefore on the dsa_switch_ops to install its
      VLANs.
      
      So dsa_port_vid_add now only has one single caller. So we can simplify
      the call graph to what it was before, aka:
      
              dsa_slave_vlan_rx_add_vid     dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88236591
    • V
      net: dsa: tag_8021q: add a context structure · 5899ee36
      Vladimir Oltean 提交于
      While working on another tag_8021q driver implementation, some things
      became apparent:
      
      - It is not mandatory for a DSA driver to offload the tag_8021q VLANs by
        using the VLAN table per se. For example, it can add custom TCAM rules
        that simply encapsulate RX traffic, and redirect & decapsulate rules
        for TX traffic. For such a driver, it makes no sense to receive the
        tag_8021q configuration through the same callback as it receives the
        VLAN configuration from the bridge and the 8021q modules.
      
      - Currently, sja1105 (the only tag_8021q user) sets a
        priv->expect_dsa_8021q variable to distinguish between the bridge
        calling, and tag_8021q calling. That can be improved, to say the
        least.
      
      - The crosschip bridging operations are, in fact, stateful already. The
        list of crosschip_links must be kept by the caller and passed to the
        relevant tag_8021q functions.
      
      So it would be nice if the tag_8021q configuration was more
      self-contained. This patch attempts to do that.
      
      Create a struct dsa_8021q_context which encapsulates a struct
      dsa_switch, and has 2 function pointers for adding and deleting a VLAN.
      These will replace the previous channel to the driver, which was through
      the .port_vlan_add and .port_vlan_del callbacks of dsa_switch_ops.
      
      Also put the list of crosschip_links into this dsa_8021q_context.
      Drivers that don't support cross-chip bridging can simply omit to
      initialize this list, as long as they dont call any cross-chip function.
      
      The sja1105_vlan_add and sja1105_vlan_del functions are refactored into
      a smaller sja1105_vlan_add_one, which now has 2 entry points:
      - sja1105_vlan_add, from struct dsa_switch_ops
      - sja1105_dsa_8021q_vlan_add, from the tag_8021q ops
      But even this change is fairly trivial. It just reflects the fact that
      for sja1105, the VLANs from these 2 channels end up in the same hardware
      table. However that is not necessarily true in the general sense (and
      that's the reason for making this change).
      
      The rest of the patch is mostly plain refactoring of "ds" -> "ctx". The
      dsa_8021q_context structure needs to be propagated because adding a VLAN
      is now done through the ops function pointers inside of it.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5899ee36
    • V
      net: dsa: tag_8021q: setup tagging via a single function call · 7e092af2
      Vladimir Oltean 提交于
      There is no point in calling dsa_port_setup_8021q_tagging for each
      individual port. Additionally, it will become more difficult to do that
      when we'll have a context structure to tag_8021q (next patch). So
      refactor this now.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e092af2
    • I
      bridge: mcast: Fix incomplete MDB dump · 12913f74
      Ido Schimmel 提交于
      Each MDB entry is encoded in a nested netlink attribute called
      'MDBA_MDB_ENTRY'. In turn, this attribute contains another nested
      attributed called 'MDBA_MDB_ENTRY_INFO', which encodes a single port
      group entry within the MDB entry.
      
      The cited commit added the ability to restart a dump from a specific
      port group entry. However, on failure to add a port group entry to the
      dump the entire MDB entry (stored in 'nest2') is removed, resulting in
      missing port group entries.
      
      Fix this by finalizing the MDB entry with the partial list of already
      encoded port group entries.
      
      Fixes: 5205e919 ("net: bridge: mcast: add support for src list and filter mode dumping")
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Acked-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12913f74
    • C
      ipv6: remove redundant assignment to variable err · 2291267e
      Colin Ian King 提交于
      The variable err is being initialized with a value that is never read and
      it is being updated later with a new value. The initialization is redundant
      and can be removed.  Also re-order variable declarations in reverse
      Christmas tree ordering.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2291267e
  4. 11 9月, 2020 15 次提交