1. 05 12月, 2019 29 次提交
  2. 01 12月, 2019 11 次提交
    • J
      cfg80211: call disconnect_wk when AP stops · 16a300fb
      Johannes Berg 提交于
      [ Upstream commit e005bd7ddea06784c1eb91ac5bb6b171a94f3b05 ]
      
      Since we now prevent regulatory restore during STA disconnect
      if concurrent AP interfaces are active, we need to reschedule
      this check when the AP state changes. This fixes never doing
      a restore when an AP is the last interface to stop. Or to put
      it another way: we need to re-check after anything we check
      here changes.
      
      Cc: stable@vger.kernel.org
      Fixes: 113f3aaa81bd ("cfg80211: Prevent regulatory restore during STA disconnect in concurrent interfaces")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      16a300fb
    • D
      ipv6: Fix handling of LLA with VRF and sockets bound to VRF · 2b3541ff
      David Ahern 提交于
      [ Upstream commit c2027d1e17582903e368abf5d4838b22a98f2b7b ]
      
      A recent commit allows sockets bound to a VRF to receive ipv6 link local
      packets. However, it only works for UDP and worse TCP connection attempts
      to the LLA with the only listener bound to the VRF just hang where as
      before the client gets a reset and connection refused. Fix by adjusting
      ir_iif for LL addresses and packets received through a device enslaved
      to a VRF.
      
      Fixes: 6f12fa775530 ("vrf: mark skb for multicast or link-local as enslaved to VRF")
      Reported-by: NDonald Sharp <sharpd@cumulusnetworks.com>
      Cc: Mike Manning <mmanning@vyatta.att-mail.com>
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2b3541ff
    • S
      cfg80211: Prevent regulatory restore during STA disconnect in concurrent interfaces · c24fe780
      Sriram R 提交于
      [ Upstream commit 113f3aaa81bd56aba02659786ed65cbd9cb9a6fc ]
      
      Currently when an AP and STA interfaces are active in the same or different
      radios, regulatory settings are restored whenever the STA disconnects. This
      restores all channel information including dfs states in all radios.
      For example, if an AP interface is active in one radio and STA in another,
      when radar is detected on the AP interface, the dfs state of the channel
      will be changed to UNAVAILABLE. But when the STA interface disconnects,
      this issues a regulatory disconnect hint which restores all regulatory
      settings in all the radios attached and thereby losing the stored dfs
      state on the other radio where the channel was marked as unavailable
      earlier. Hence prevent such regulatory restore whenever another active
      beaconing interface is present in the same or other radios.
      Signed-off-by: NSriram R <srirrama@codeaurora.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c24fe780
    • T
      net: bpfilter: fix iptables failure if bpfilter_umh is disabled · e6c6c043
      Taehee Yoo 提交于
      [ Upstream commit 97adaddaa6db7a8af81b9b11e30cbe3628cd6700 ]
      
      When iptables command is executed, ip_{set/get}sockopt() try to upload
      bpfilter.ko if bpfilter is enabled. if it couldn't find bpfilter.ko,
      command is failed.
      bpfilter.ko is generated if CONFIG_BPFILTER_UMH is enabled.
      ip_{set/get}sockopt() only checks CONFIG_BPFILTER.
      So that if CONFIG_BPFILTER is enabled and CONFIG_BPFILTER_UMH is disabled,
      iptables command is always failed.
      
      test config:
         CONFIG_BPFILTER=y
         # CONFIG_BPFILTER_UMH is not set
      
      test command:
         %iptables -L
         iptables: No chain/target/match by that name.
      
      Fixes: d2ba09c1 ("net: add skeleton of bpfilter kernel module")
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e6c6c043
    • A
      sock_diag: fix autoloading of the raw_diag module · 811c8141
      Andrei Vagin 提交于
      [ Upstream commit c34c1287778b080ed692c0a46a8e345206cc29e6 ]
      
      IPPROTO_RAW isn't registred as an inet protocol, so
      inet_protos[protocol] is always NULL for it.
      
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      Cc: Xin Long <lucien.xin@gmail.com>
      Fixes: bf2ae2e4 ("sock_diag: request _diag module only when the family or proto has been registered")
      Signed-off-by: NAndrei Vagin <avagin@gmail.com>
      Reviewed-by: NCyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      811c8141
    • A
      openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS · 465073e4
      Arnd Bergmann 提交于
      [ Upstream commit a277d516de5f498c91d91189717ef7e01102ad27 ]
      
      When CONFIG_CC_OPTIMIZE_FOR_DEBUGGING is enabled, the compiler
      fails to optimize out a dead code path, which leads to a link failure:
      
      net/openvswitch/conntrack.o: In function `ovs_ct_set_labels':
      conntrack.c:(.text+0x2e60): undefined reference to `nf_connlabels_replace'
      
      In this configuration, we can take a shortcut, and completely
      remove the contrack label code. This may also help the regular
      optimization.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      465073e4
    • E
      net: do not abort bulk send on BQL status · f9fca78e
      Eric Dumazet 提交于
      [ Upstream commit fe60faa5063822f2d555f4f326c7dd72a60929bf ]
      
      Before calling dev_hard_start_xmit(), upper layers tried
      to cook optimal skb list based on BQL budget.
      
      Problem is that GSO packets can end up comsuming more than
      the BQL budget.
      
      Breaking the loop is not useful, since requeued packets
      are ahead of any packets still in the qdisc.
      
      It is also more expensive, since next TX completion will
      push these packets later, while skbs are not in cpu caches.
      
      It is also a behavior difference with TSO packets, that can
      break the BQL limit by a large amount.
      
      Note that drivers should use __netdev_tx_sent_queue()
      in order to have optimal xmit_more support, and avoid
      useless atomic operations as shown in the following patch.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f9fca78e
    • H
      ipv4/igmp: fix v1/v2 switchback timeout based on rfc3376, 8.12 · 32d7474b
      Hangbin Liu 提交于
      [ Upstream commit 966c37f2d77eb44d47af8e919267b1ba675b2eca ]
      
      Similiar with ipv6 mcast commit 89225d1c ("net: ipv6: mld: fix v1/v2
      switchback timeout to rfc3810, 9.12.")
      
      i) RFC3376 8.12. Older Version Querier Present Timeout says:
      
         The Older Version Querier Interval is the time-out for transitioning
         a host back to IGMPv3 mode once an older version query is heard.
         When an older version query is received, hosts set their Older
         Version Querier Present Timer to Older Version Querier Interval.
      
         This value MUST be ((the Robustness Variable) times (the Query
         Interval in the last Query received)) plus (one Query Response
         Interval).
      
      Currently we only use a hardcode value IGMP_V1/v2_ROUTER_PRESENT_TIMEOUT.
      Fix it by adding two new items mr_qi(Query Interval) and mr_qri(Query Response
      Interval) in struct in_device.
      
      Now we can calculate the switchback time via (mr_qrv * mr_qi) + mr_qri.
      We need update these values when receive IGMPv3 queries.
      Reported-by: NYing Xu <yinxu@redhat.com>
      Signed-off-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      32d7474b
    • J
      sunrpc: safely reallow resvport min/max inversion · f9304c62
      J. Bruce Fields 提交于
      [ Upstream commit 826799e66e8683e5698e140bb9ef69afc8c0014e ]
      
      Commits ffb6ca33 and e08ea3a9 prevent setting xprt_min_resvport
      greater than xprt_max_resvport, but may also break simple code that sets
      one parameter then the other, if the new range does not overlap the old.
      
      Also it looks racy to me, unless there's some serialization I'm not
      seeing.  Granted it would probably require malicious privileged processes
      (unless there's a chance these might eventually be settable in unprivileged
      containers), but still it seems better not to let userspace panic the
      kernel.
      
      Simpler seems to be to allow setting the parameters to whatever you want
      but interpret xprt_min_resvport > xprt_max_resvport as the empty range.
      
      Fixes: ffb6ca33 "sunrpc: Prevent resvport min/max inversion..."
      Fixes: e08ea3a9 "sunrpc: Prevent rexvport min/max inversion..."
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f9304c62
    • T
      SUNRPC: Fix a compile warning for cmpxchg64() · 7983dea8
      Trond Myklebust 提交于
      [ Upstream commit e732f4485a150492b286f3efc06f9b34dd6b9995 ]
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7983dea8
    • X
      sctp: use sk_wmem_queued to check for writable space · 4de506d5
      Xin Long 提交于
      [ Upstream commit cd305c74b0f8b49748a79a8f67fc8e5e3e0c4794 ]
      
      sk->sk_wmem_queued is used to count the size of chunks in out queue
      while sk->sk_wmem_alloc is for counting the size of chunks has been
      sent. sctp is increasing both of them before enqueuing the chunks,
      and using sk->sk_wmem_alloc to check for writable space.
      
      However, sk_wmem_alloc is also increased by 1 for the skb allocked
      for sending in sctp_packet_transmit() but it will not wake up the
      waiters when sk_wmem_alloc is decreased in this skb's destructor.
      
      If msg size is equal to sk_sndbuf and sendmsg is waiting for sndbuf,
      the check 'msg_len <= sctp_wspace(asoc)' in sctp_wait_for_sndbuf()
      will keep waiting if there's a skb allocked in sctp_packet_transmit,
      and later even if this skb got freed, the waiting thread will never
      get waked up.
      
      This issue has been there since very beginning, so we change to use
      sk->sk_wmem_queued to check for writable space as sk_wmem_queued is
      not increased for the skb allocked for sending, also as TCP does.
      
      SOCK_SNDBUF_LOCK check is also removed here as it's for tx buf auto
      tuning which I will add in another patch.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4de506d5