Skip to content
  1. Jun 13, 2017
  2. Jun 08, 2017
    • Johannes Berg's avatar
      mac80211: manage RX BA session offload without SKB queue · 699cb58c
      Johannes Berg authored
      
      
      Instead of using the SKB queue with the fake pkt_type for the
      offloaded RX BA session management, also handle this with the
      normal aggregation state machine worker. This also makes the
      use of this more reliable since it gets rid of the allocation
      of the fake skb.
      
      Combined with the previous patch, this finally allows us to
      get rid of the pkt_type hack entirely, so do that as well.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      699cb58c
  3. Jun 06, 2017
  4. Jun 05, 2017
    • Haishuang Yan's avatar
      devlink: fix potential memort leak · 6044bd4a
      Haishuang Yan authored
      
      
      We must free allocated skb when genlmsg_put() return fails.
      
      Fixes: 1555d204 ("devlink: Support for pipeline debug (dpipe)")
      Signed-off-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6044bd4a
    • Jiri Pirko's avatar
      net: sched: select cls when cls_act is enabled · 8ec1507d
      Jiri Pirko authored
      
      
      It really makes no sense to have cls_act enabled without cls. In that
      case, the cls_act code is dead. So select it.
      
      This also fixes an issue recently reported by kbuild robot:
      [linux-next:master 1326/4151] net/sched/act_api.c:37:18: error: implicit declaration of function 'tcf_chain_get'
      
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Fixes: db50514f ("net: sched: add termination action to allow goto chain")
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ec1507d
    • David Howells's avatar
      rxrpc: Add service upgrade support for client connections · 4e255721
      David Howells authored
      
      
      Make it possible for a client to use AuriStor's service upgrade facility.
      
      The client does this by adding an RXRPC_UPGRADE_SERVICE control message to
      the first sendmsg() of a call.  This takes no parameters.
      
      When recvmsg() starts returning data from the call, the service ID field in
      the returned msg_name will reflect the result of the upgrade attempt.  If
      the upgrade was ignored, srx_service will match what was set in the
      sendmsg(); if the upgrade happened the srx_service will be altered to
      indicate the service the server upgraded to.
      
      Note that:
      
       (1) The choice of upgrade service is up to the server
      
       (2) Further client calls to the same server that would share a connection
           are blocked if an upgrade probe is in progress.
      
       (3) This should only be used to probe the service.  Clients should then
           use the returned service ID in all subsequent communications with that
           server (and not set the upgrade).  Note that the kernel will not
           retain this information should the connection expire from its cache.
      
       (4) If a server that supports upgrading is replaced by one that doesn't,
           whilst a connection is live, and if the replacement is running, say,
           OpenAFS 1.6.4 or older or an older IBM AFS, then the replacement
           server will not respond to packets sent to the upgraded connection.
      
           At this point, calls will time out and the server must be reprobed.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      4e255721
    • David Howells's avatar
      rxrpc: Implement service upgrade · 4722974d
      David Howells authored
      
      
      Implement AuriStor's service upgrade facility.  There are three problems
      that this is meant to deal with:
      
       (1) Various of the standard AFS RPC calls have IPv4 addresses in their
           requests and/or replies - but there's no room for including IPv6
           addresses.
      
       (2) Definition of IPv6-specific RPC operations in the standard operation
           sets has not yet been achieved.
      
       (3) One could envision the creation a new service on the same port that as
           the original service.  The new service could implement improved
           operations - and the client could try this first, falling back to the
           original service if it's not there.
      
           Unfortunately, certain servers ignore packets addressed to a service
           they don't implement and don't respond in any way - not even with an
           ABORT.  This means that the client must then wait for the call timeout
           to occur.
      
      What service upgrade does is to see if the connection is marked as being
      'upgradeable' and if so, change the service ID in the server and thus the
      request and reply formats.  Note that the upgrade isn't mandatory - a
      server that supports only the original call set will ignore the upgrade
      request.
      
      In the protocol, the procedure is then as follows:
      
       (1) To request an upgrade, the first DATA packet in a new connection must
           have the userStatus set to 1 (this is normally 0).  The userStatus
           value is normally ignored by the server.
      
       (2) If the server doesn't support upgrading, the reply packets will
           contain the same service ID as for the first request packet.
      
       (3) If the server does support upgrading, all future reply packets on that
           connection will contain the new service ID and the new service ID will
           be applied to *all* further calls on that connection as well.
      
       (4) The RPC op used to probe the upgrade must take the same request data
           as the shadow call in the upgrade set (but may return a different
           reply).  GetCapability RPC ops were added to all standard sets for
           just this purpose.  Ops where the request formats differ cannot be
           used for probing.
      
       (5) The client must wait for completion of the probe before sending any
           further RPC ops to the same destination.  It should then use the
           service ID that recvmsg() reported back in all future calls.
      
       (6) The shadow service must have call definitions for all the operation
           IDs defined by the original service.
      
      
      To support service upgrading, a server should:
      
       (1) Call bind() twice on its AF_RXRPC socket before calling listen().
           Each bind() should supply a different service ID, but the transport
           addresses must be the same.  This allows the server to receive
           requests with either service ID.
      
       (2) Enable automatic upgrading by calling setsockopt(), specifying
           RXRPC_UPGRADEABLE_SERVICE and passing in a two-member array of
           unsigned shorts as the argument:
      
      	unsigned short optval[2];
      
           This specifies a pair of service IDs.  They must be different and must
           match the service IDs bound to the socket.  Member 0 is the service ID
           to upgrade from and member 1 is the service ID to upgrade to.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      4722974d
    • David Howells's avatar
      rxrpc: Permit multiple service binding · 28036f44
      David Howells authored
      
      
      Permit bind() to be called on an AF_RXRPC socket more than once (currently
      maximum twice) to bind multiple listening services to it.  There are some
      restrictions:
      
       (1) All bind() calls involved must have a non-zero service ID.
      
       (2) The service IDs must all be different.
      
       (3) The rest of the address (notably the transport part) must be the same
           in all (a single UDP socket is shared).
      
       (4) This must be done before listen() or sendmsg() is called.
      
      This allows someone to connect to the service socket with different service
      IDs and lays the foundation for service upgrading.
      
      The service ID used by an incoming call can be extracted from the msg_name
      returned by recvmsg().
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      28036f44
    • David Howells's avatar
      rxrpc: Separate the connection's protocol service ID from the lookup ID · 68d6d1ae
      David Howells authored
      
      
      Keep the rxrpc_connection struct's idea of the service ID that is exposed
      in the protocol separate from the service ID that's used as a lookup key.
      
      This allows the protocol service ID on a client connection to get upgraded
      without making the connection unfindable for other client calls that also
      would like to use the upgraded connection.
      
      The connection's actual service ID is then returned through recvmsg() by
      way of msg_name.
      
      Whilst we're at it, we get rid of the last_service_id field from each
      channel.  The service ID is per-connection, not per-call and an entire
      connection is upgraded in one go.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      68d6d1ae
    • Haishuang Yan's avatar
      sit: reload iphdr in ipip6_rcv · b699d003
      Haishuang Yan authored
      
      
      Since iptunnel_pull_header() can call pskb_may_pull(),
      we must reload any pointer that was related to skb->head.
      
      Fixes: a09a4c8d ("tunnels: Remove encapsulation offloads on decap")
      Signed-off-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b699d003
    • Jason A. Donenfeld's avatar
    • Jason A. Donenfeld's avatar
      ipsec: check return value of skb_to_sgvec always · 3f297707
      Jason A. Donenfeld authored
      
      
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3f297707
    • Jason A. Donenfeld's avatar
      skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow · 48a1df65
      Jason A. Donenfeld authored
      
      
      This is a defense-in-depth measure in response to bugs like
      4d6fa57b ("macsec: avoid heap overflow in skb_to_sgvec"). There's
      not only a potential overflow of sglist items, but also a stack overflow
      potential, so we fix this by limiting the amount of recursion this function
      is allowed to do. Not actually providing a bounded base case is a future
      disaster that we can easily avoid here.
      
      As a small matter of house keeping, we take this opportunity to move the
      documentation comment over the actual function the documentation is for.
      
      While this could be implemented by using an explicit stack of skbuffs,
      when implementing this, the function complexity increased considerably,
      and I don't think such complexity and bloat is actually worth it. So,
      instead I built this and tested it on x86, x86_64, ARM, ARM64, and MIPS,
      and measured the stack usage there. I also reverted the recent MIPS
      changes that give it a separate IRQ stack, so that I could experience
      some worst-case situations. I found that limiting it to 24 layers deep
      yielded a good stack usage with room for safety, as well as being much
      deeper than any driver actually ever creates.
      
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Sabrina Dubroca <sd@queasysnail.net>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48a1df65
    • Eric Dumazet's avatar
      net: ping: do not abuse udp_poll() · 77d4b1d3
      Eric Dumazet authored
      
      
      Alexander reported various KASAN messages triggered in recent kernels
      
      The problem is that ping sockets should not use udp_poll() in the first
      place, and recent changes in UDP stack finally exposed this old bug.
      
      Fixes: c319b4d7 ("net: ipv4: add IPPROTO_ICMP socket kind")
      Fixes: 6d0bfe22 ("net: ipv6: Add IPv6 support to the ping socket.")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Cc: Solar Designer <solar@openwall.com>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: Lorenzo Colitti <lorenzo@google.com>
      Acked-By: default avatarLorenzo Colitti <lorenzo@google.com>
      Tested-By: default avatarLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77d4b1d3
    • Florian Fainelli's avatar
      net: dsa: Fix stale cpu_switch reference after unbind then bind · b07ac989
      Florian Fainelli authored
      
      
      Commit 9520ed8f ("net: dsa: use cpu_switch instead of ds[0]")
      replaced the use of dst->ds[0] with dst->cpu_switch since that is
      functionally equivalent, however, we can now run into an use after free
      scenario after unbinding then rebinding the switch driver.
      
      The use after free happens because we do correctly initialize
      dst->cpu_switch the first time we probe in dsa_cpu_parse(), then we
      unbind the driver: dsa_dst_unapply() is called, and we rebind again.
      dst->cpu_switch now points to a freed "ds" structure, and so when we
      finally dereference it in dsa_cpu_port_ethtool_setup(), we oops.
      
      To fix this, simply set dst->cpu_switch to NULL in dsa_dst_unapply()
      which guarantees that we always correctly re-assign dst->cpu_switch in
      dsa_cpu_parse().
      
      Fixes: 9520ed8f ("net: dsa: use cpu_switch instead of ds[0]")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b07ac989
    • David S. Miller's avatar
      ipv6: Fix leak in ipv6_gso_segment(). · e3e86b51
      David S. Miller authored
      
      
      If ip6_find_1stfragopt() fails and we return an error we have to free
      up 'segs' because nobody else is going to.
      
      Fixes: 2423496a ("ipv6: Prevent overrun when parsing v6 header options")
      Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3e86b51
    • Sowmini Varadhan's avatar
      neigh: Really delete an arp/neigh entry on "ip neigh delete" or "arp -d" · 5071034e
      Sowmini Varadhan authored
      
      
      The command
        # arp -s 62.2.0.1 a:b:c:d:e:f dev eth2
      adds an entry like the following (listed by "arp -an")
        ? (62.2.0.1) at 0a:0b:0c:0d:0e:0f [ether] PERM on eth2
      but the symmetric deletion command
        # arp -i eth2 -d 62.2.0.1
      does not remove the PERM entry from the table, and instead leaves behind
        ? (62.2.0.1) at <incomplete> on eth2
      
      The reason is that there is a refcnt of 1 for the arp_tbl itself
      (neigh_alloc starts off the entry with a refcnt of 1), thus
      the neigh_release() call from arp_invalidate() will (at best) just
      decrement the ref to 1, but will never actually free it from the
      table.
      
      To fix this, we need to do something like neigh_forced_gc: if
      the refcnt is 1 (i.e., on the table's ref), remove the entry from
      the table and free it. This patch refactors and shares common code
      between neigh_forced_gc and the newly added neigh_remove_one.
      
      A similar issue exists for IPv6 Neighbor Cache entries, and is fixed
      in a similar manner by this patch.
      
      Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Reviewed-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5071034e
    • Florian Fainelli's avatar
      net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse() · 14be36c2
      Florian Fainelli authored
      
      
      There was no reason for duplicating the code that initializes
      ds->enabled_port_mask in both dsa_parse_ports_dn() and
      dsa_parse_ports(), instead move this to dsa_ds_parse() which is early
      enough before ops->setup() has run.
      
      While at it, we can now make dsa_is_cpu_port() check ds->cpu_port_mask
      which is a step towards being multi-CPU port capable.
      
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14be36c2
    • Florian Fainelli's avatar
      net: dsa: Consistently use dsa_port for dsa_*_port_{apply, unapply} · e41c1b50
      Florian Fainelli authored
      
      
      We have all the information we need in dsa_port, so use it instead of
      repeating the same arguments over and over again.
      
      Suggested-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e41c1b50
    • Florian Fainelli's avatar
      net: dsa: Pass dsa_port reference to ethtool setup/restore · 937c7df8
      Florian Fainelli authored
      
      
      We do not need to have a reference to a dsa_switch, instead we should
      pass a reference to a CPU dsa_port, change that. This is a preliminary
      change to better support multiple CPU ports.
      
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      937c7df8
    • Soheil Hassas Yeganeh's avatar
      sock: reset sk_err when the error queue is empty · 38b25793
      Soheil Hassas Yeganeh authored
      
      
      Prior to f5f99309 (sock: do not set sk_err in
      sock_dequeue_err_skb), sk_err was reset to the error of
      the skb on the head of the error queue.
      
      Applications, most notably ping, are relying on this
      behavior to reset sk_err for ICMP packets.
      
      Set sk_err to the ICMP error when there is an ICMP packet
      at the head of the error queue.
      
      Fixes: f5f99309 (sock: do not set sk_err in sock_dequeue_err_skb)
      Reported-by: default avatarCyril Hrubis <chrubis@suse.cz>
      Tested-by: default avatarCyril Hrubis <chrubis@suse.cz>
      Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38b25793
  5. Jun 04, 2017
  6. Jun 02, 2017
  7. Jun 01, 2017
Loading