1. 13 4月, 2017 1 次提交
  2. 31 3月, 2017 2 次提交
  3. 29 3月, 2017 1 次提交
    • M
      mac80211: mesh: drop new node with weak power · ed92a9b5
      Masashi Honma 提交于
      On some practical cases, it is useful to drop new node in the distance.
      Because mesh metric is calculated with hop count and without RSSI
      information, a node far from local peer and near to destination node
      could be used as best path.
      
      For example, the nodes are located in linear. Distance of 0 - 1 and
      1 - 2 and 2 - 3 is 20meters. 0 to 3 signal is very weak.
      
          0 --- 1 --- 2 --- 3
      
      Though most robust path from 0 to 3 is 0 -> 1 -> 2 -> 3,
      unfortunately, node 0 could recognize node 3 as neighbor. Then node 3
      could be next of node 0. This patch aims to avoid such a case.
      
      [Johannes:]
      Dropping the node entirely isn't ideal, but at least with encryption
      there will be a limit on # of keys the hardware can deal with, and
      there might also be a limit on the number of stations it supports.
      Signed-off-by: NMasashi Honma <masashi.honma@gmail.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ed92a9b5
  4. 17 3月, 2017 1 次提交
  5. 16 3月, 2017 2 次提交
  6. 08 3月, 2017 1 次提交
    • J
      mac80211: reject/clear user rate mask if not usable · e8e4f528
      Johannes Berg 提交于
      If the user rate mask results in no (basic) rates being usable,
      clear it. Also, if we're already operating when it's set, reject
      it instead.
      
      Technically, selecting basic rates as the criterion is a bit too
      restrictive, but calculating the usable rates over all stations
      (e.g. in AP mode) is harder, and all stations must support the
      basic rates. Similarly, in client mode, the basic rates will be
      used anyway for control frames.
      
      This fixes the "no supported rates (...) in rate_mask ..." warning
      that occurs on TX when you've selected a rate mask that's not
      compatible with the connection (e.g. an AP that enables only the
      rates 36, 48, 54 and you've selected only 6, 9, 12.)
      Reported-by: NKirtika Ruchandani <kirtika@google.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e8e4f528
  7. 07 3月, 2017 2 次提交
  8. 06 3月, 2017 14 次提交
  9. 04 3月, 2017 3 次提交
  10. 03 3月, 2017 10 次提交
    • P
      netfilter: nf_tables: don't call nfnetlink_set_err() if nfnetlink_send() fails · 25e94a99
      Pablo Neira Ayuso 提交于
      The underlying nlmsg_multicast() already sets sk->sk_err for us to
      notify socket overruns, so we should not do anything with this return
      value. So we just call nfnetlink_set_err() if:
      
      1) We fail to allocate the netlink message.
      
      or
      
      2) We don't have enough space in the netlink message to place attributes,
         which means that we likely need to allocate a larger message.
      
      Before this patch, the internal ESRCH netlink error code was propagated
      to userspace, which is quite misleading. Netlink semantics mandate that
      listeners just hit ENOBUFS if the socket buffer overruns.
      Reported-by: NAlexander Alemayhu <alexander@alemayhu.com>
      Tested-by: NAlexander Alemayhu <alexander@alemayhu.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      25e94a99
    • P
      netfilter: nft_set_rbtree: incorrect assumption on lower interval lookups · f9121355
      Pablo Neira Ayuso 提交于
      In case of adjacent ranges, we may indeed see either the high part of
      the range in first place or the low part of it. Remove this incorrect
      assumption, let's make sure we annotate the low part of the interval in
      case of we have adjacent interva intervals so we hit a matching in
      lookups.
      Reported-by: NSimon Hanisch <hanisch@wh2.tu-dresden.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      f9121355
    • C
      netfilter: nf_conntrack_sip: fix wrong memory initialisation · da2f27e9
      Christophe Leroy 提交于
      In commit 82de0be6 ("netfilter: Add helper array
      register/unregister functions"),
      struct nf_conntrack_helper sip[MAX_PORTS][4] was changed to
      sip[MAX_PORTS * 4], so the memory init should have been changed to
      memset(&sip[4 * i], 0, 4 * sizeof(sip[i]));
      
      But as the sip[] table is allocated in the BSS, it is already set to 0
      
      Fixes: 82de0be6 ("netfilter: Add helper array register/unregister functions")
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      da2f27e9
    • I
      sched/headers: Move task_struct::signal and task_struct::sighand types and... · c3edc401
      Ingo Molnar 提交于
      sched/headers: Move task_struct::signal and task_struct::sighand types and accessors into <linux/sched/signal.h>
      
      task_struct::signal and task_struct::sighand are pointers, which would normally make it
      straightforward to not define those types in sched.h.
      
      That is not so, because the types are accompanied by a myriad of APIs (macros and inline
      functions) that dereference them.
      
      Split the types and the APIs out of sched.h and move them into a new header, <linux/sched/signal.h>.
      
      With this change sched.h does not know about 'struct signal' and 'struct sighand' anymore,
      trying to put accessors into sched.h as a test fails the following way:
      
        ./include/linux/sched.h: In function ‘test_signal_types’:
        ./include/linux/sched.h:2461:18: error: dereferencing pointer to incomplete type ‘struct signal_struct’
                          ^
      
      This reduces the size and complexity of sched.h significantly.
      
      Update all headers and .c code that relied on getting the signal handling
      functionality from <linux/sched.h> to include <linux/sched/signal.h>.
      
      The list of affected files in the preparatory patch was partly generated by
      grepping for the APIs, and partly by doing coverage build testing, both
      all[yes|mod|def|no]config builds on 64-bit and 32-bit x86, and an array of
      cross-architecture builds.
      
      Nevertheless some (trivial) build breakage is still expected related to rare
      Kconfig combinations and in-flight patches to various kernel code, but most
      of it should be handled by this patch.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      c3edc401
    • W
      ipv6: ignore null_entry in inet6_rtm_getroute() too · 9d6acb3b
      WANG Cong 提交于
      Like commit 1f17e2f2 ("net: ipv6: ignore null_entry on route dumps"),
      we need to ignore null entry in inet6_rtm_getroute() too.
      
      Return -ENETUNREACH here to sync with IPv4 behavior, as suggested by David.
      
      Fixes: a1a22c12 ("net: ipv6: Keep nexthop of multipath route on admin down")
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: David Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d6acb3b
    • W
      tcp: fix potential double free issue for fastopen_req · 7db92362
      Wei Wang 提交于
      tp->fastopen_req could potentially be double freed if a malicious
      user does the following:
      1. Enable TCP_FASTOPEN_CONNECT sockopt and do a connect() on the socket.
      2. Call connect() with AF_UNSPEC to disconnect the socket.
      3. Make this socket a listening socket by calling listen().
      4. Accept incoming connections and generate child sockets. All child
         sockets will get a copy of the pointer of fastopen_req.
      5. Call close() on all sockets. fastopen_req will get freed multiple
         times.
      
      Fixes: 19f6d3f3 ("net/tcp-fastopen: Add new API support")
      Reported-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7db92362
    • A
      net: Introduce sk_clone_lock() error path routine · 94352d45
      Arnaldo Carvalho de Melo 提交于
      When handling problems in cloning a socket with the sk_clone_locked()
      function we need to perform several steps that were open coded in it and
      its callers, so introduce a routine to avoid this duplication:
      sk_free_unlock_clone().
      
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/n/net-ui6laqkotycunhtmqryl9bfx@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94352d45
    • A
      dccp: Unlock sock before calling sk_free() · d5afb6f9
      Arnaldo Carvalho de Melo 提交于
      The code where sk_clone() came from created a new socket and locked it,
      but then, on the error path didn't unlock it.
      
      This problem stayed there for a long while, till b0691c8e ("net:
      Unlock sock before calling sk_free()") fixed it, but unfortunately the
      callers of sk_clone() (now sk_clone_locked()) were not audited and the
      one in dccp_create_openreq_child() remained.
      
      Now in the age of the syskaller fuzzer, this was finally uncovered, as
      reported by Dmitry:
      
       ---- 8< ----
      
      I've got the following report while running syzkaller fuzzer on
      86292b33 ("Merge branch 'akpm' (patches from Andrew)")
      
        [ BUG: held lock freed! ]
        4.10.0+ #234 Not tainted
        -------------------------
        syz-executor6/6898 is freeing memory
        ffff88006286cac0-ffff88006286d3b7, with a lock still held there!
         (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>] spin_lock
        include/linux/spinlock.h:299 [inline]
         (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>]
        sk_clone_lock+0x3d9/0x12c0 net/core/sock.c:1504
        5 locks held by syz-executor6/6898:
         #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffff839a34b4>] lock_sock
        include/net/sock.h:1460 [inline]
         #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffff839a34b4>]
        inet_stream_connect+0x44/0xa0 net/ipv4/af_inet.c:681
         #1:  (rcu_read_lock){......}, at: [<ffffffff83bc1c2a>]
        inet6_csk_xmit+0x12a/0x5d0 net/ipv6/inet6_connection_sock.c:126
         #2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>] __skb_unlink
        include/linux/skbuff.h:1767 [inline]
         #2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>] __skb_dequeue
        include/linux/skbuff.h:1783 [inline]
         #2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>]
        process_backlog+0x264/0x730 net/core/dev.c:4835
         #3:  (rcu_read_lock){......}, at: [<ffffffff83aeb5c0>]
        ip6_input_finish+0x0/0x1700 net/ipv6/ip6_input.c:59
         #4:  (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>] spin_lock
        include/linux/spinlock.h:299 [inline]
         #4:  (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>]
        sk_clone_lock+0x3d9/0x12c0 net/core/sock.c:1504
      
      Fix it just like was done by b0691c8e ("net: Unlock sock before calling
      sk_free()").
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20170301153510.GE15145@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5afb6f9
    • P
      openvswitch: actions: fixed a brace coding style warning · f1304f7b
      Peter Downs 提交于
      Fixed a brace coding style warning reported by checkpatch.pl
      Signed-off-by: NPeter Downs <padowns@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1304f7b
    • W
      ipv6: check for ip6_null_entry in __ip6_del_rt_siblings() · e3330039
      WANG Cong 提交于
      Andrey reported a NULL pointer deref bug in ipv6_route_ioctl()
      -> ip6_route_del() -> __ip6_del_rt_siblings() code path. This is
      because ip6_null_entry is returned in this path since ip6_null_entry
      is kinda default for a ipv6 route table root node. Quote from
      David Ahern:
      
       ip6_null_entry is the root of all ipv6 fib tables making it integrated
       into the table ...
      
      We should ignore any attempt of trying to delete it, like we do in
      __ip6_del_rt() path and several others.
      Reported-by: NAndrey Konovalov <andreyknvl@google.com>
      Fixes: 0ae81335 ("net: ipv6: Allow shorthand delete of all nexthops in multipath route")
      Cc: David Ahern <dsa@cumulusnetworks.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3330039
  11. 02 3月, 2017 3 次提交