1. 04 Jun, 2014 2 commits
    • Oleg Nesterov's avatar
      oom_kill: change oom_kill.c to use for_each_thread() · 7fdd16a1
      Oleg Nesterov authored
      commit 1da4db0c upstream.
      
      Change oom_kill.c to use for_each_thread() rather than the racy
      while_each_thread() which can loop forever if we race with exit.
      
      Note also that most users were buggy even if while_each_thread() was
      fine, the task can exit even _before_ rcu_read_lock().
      
      Fortunately the new for_each_thread() only requires the stable
      task_struct, so this change fixes both problems.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Reviewed-by: default avatarSergey Dyasly <dserrg@gmail.com>
      Tested-by: default avatarSergey Dyasly <dserrg@gmail.com>
      Reviewed-by: default avatarSameer Nanda <snanda@chromium.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mandeep Singh Baines <msb@chromium.org>
      Cc: "Ma, Xindong" <xindong.ma@intel.com>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      7fdd16a1
    • Oleg Nesterov's avatar
      introduce for_each_thread() to replace the buggy while_each_thread() · ebe219e4
      Oleg Nesterov authored
      commit 0c740d0a upstream.
      
      while_each_thread() and next_thread() should die, almost every lockless
      usage is wrong.
      
      1. Unless g == current, the lockless while_each_thread() is not safe.
      
         while_each_thread(g, t) can loop forever if g exits, next_thread()
         can't reach the unhashed thread in this case. Note that this can
         happen even if g is the group leader, it can exec.
      
      2. Even if while_each_thread() itself was correct, people often use
         it wrongly.
      
         It was never safe to just take rcu_read_lock() and loop unless
         you verify that pid_alive(g) == T, even the first next_thread()
         can point to the already freed/reused memory.
      
      This patch adds signal_struct->thread_head and task->thread_node to
      create the normal rcu-safe list with the stable head.  The new
      for_each_thread(g, t) helper is always safe under rcu_read_lock() as
      long as this task_struct can't go away.
      
      Note: of course it is ugly to have both task_struct->thread_node and the
      old task_struct->thread_group, we will kill it later, after we change
      the users of while_each_thread() to use for_each_thread().
      
      Perhaps we can kill it even before we convert all users, we can
      reimplement next_thread(t) using the new thread_head/thread_node.  But
      we can't do this right now because this will lead to subtle behavioural
      changes.  For example, do/while_each_thread() always sees at least one
      task, while for_each_thread() can do nothing if the whole thread group
      has died.  Or thread_group_empty(), currently its semantics is not clear
      unless thread_group_leader(p) and we need to audit the callers before we
      can change it.
      
      So this patch adds the new interface which has to coexist with the old
      one for some time, hopefully the next changes will be more or less
      straightforward and the old one will go away soon.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Reviewed-by: default avatarSergey Dyasly <dserrg@gmail.com>
      Tested-by: default avatarSergey Dyasly <dserrg@gmail.com>
      Reviewed-by: default avatarSameer Nanda <snanda@chromium.org>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mandeep Singh Baines <msb@chromium.org>
      Cc: "Ma, Xindong" <xindong.ma@intel.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ebe219e4
  2. 29 May, 2014 38 commits
    • Jiri Slaby's avatar
      Linux 3.12.21 · 80e7980e
      Jiri Slaby authored
      80e7980e
    • Eric Dumazet's avatar
      net-gro: reset skb->truesize in napi_reuse_skb() · ac993cf2
      Eric Dumazet authored
      [ Upstream commit e33d0ba8 ]
      
      Recycling skb always had been very tough...
      
      This time it appears GRO layer can accumulate skb->truesize
      adjustments made by drivers when they attach a fragment to skb.
      
      skb_gro_receive() can only subtract from skb->truesize the used part
      of a fragment.
      
      I spotted this problem seeing TcpExtPruneCalled and
      TcpExtTCPRcvCollapsed that were unexpected with a recent kernel, where
      TCP receive window should be sized properly to accept traffic coming
      from a driver not overshooting skb->truesize.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ac993cf2
    • Li RongQing's avatar
      ipv4: initialise the itag variable in __mkroute_input · ee08bba5
      Li RongQing authored
      [ Upstream commit fbdc0ad0 ]
      
      the value of itag is a random value from stack, and may not be initiated by
      fib_validate_source, which called fib_combine_itag if CONFIG_IP_ROUTE_CLASSID
      is not set
      
      This will make the cached dst uncertainty
      Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ee08bba5
    • Steffen Klassert's avatar
      ip_tunnel: Initialize the fallback device properly · 9b60fabb
      Steffen Klassert authored
      [ Upstream commit 78ff4be4 ]
      
      We need to initialize the fallback device to have a correct mtu
      set on this device. Otherwise the mtu is set to null and the device
      is unusable.
      
      Fixes: fd58156e ("IPIP: Use ip-tunneling code.")
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9b60fabb
    • Antonio Quartulli's avatar
      batman-adv: increase orig refcount when storing ref in gw_node · fa59cdc6
      Antonio Quartulli authored
      [ Upstream commit 377fe0f9 ]
      
      A pointer to the orig_node representing a bat-gateway is
      stored in the gw_node->orig_node member, but the refcount
      for such orig_node is never increased.
      This leads to memory faults when gw_node->orig_node is accessed
      and the originator has already been freed.
      
      Fix this by increasing the refcount on gw_node creation
      and decreasing it on gw_node free.
      Signed-off-by: default avatarAntonio Quartulli <antonio@open-mesh.com>
      Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      fa59cdc6
    • Cong Wang's avatar
      rtnetlink: wait for unregistering devices in rtnl_link_unregister() · 2413d40d
      Cong Wang authored
      [ Upstream commit 200b916f ]
      
      From: Cong Wang <cwang@twopensource.com>
      
      commit 50624c93 (net: Delay default_device_exit_batch until no
      devices are unregistering) introduced rtnl_lock_unregistering() for
      default_device_exit_batch(). Same race could happen we when rmmod a driver
      which calls rtnl_link_unregister() as we call dev->destructor without rtnl
      lock.
      
      For long term, I think we should clean up the mess of netdev_run_todo()
      and net namespce exit code.
      
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2413d40d
    • Susant Sahani's avatar
      ip6_tunnel: fix potential NULL pointer dereference · 166c6b57
      Susant Sahani authored
      [ Upstream commit c8965932 ]
      
      The function ip6_tnl_validate assumes that the rtnl
      attribute IFLA_IPTUN_PROTO always be filled . If this
      attribute is not filled by  the userspace application
      kernel get crashed with NULL pointer dereference. This
      patch fixes the potential kernel crash when
      IFLA_IPTUN_PROTO is missing .
      Signed-off-by: default avatarSusant Sahani <susant@redhat.com>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      166c6b57
    • Nikolay Aleksandrov's avatar
      sfc: fix calling of free_irq with already free vector · ce37c23f
      Nikolay Aleksandrov authored
      [ Upstream commit 1c363900 ]
      
      If the sfc driver is in legacy interrupt mode (either explicitly by
      using interrupt_mode module param or by falling back to it) it will
      hit a warning at kernel/irq/manage.c because it will try to free an irq
      which wasn't allocated by it in the first place because the MSI(X) irqs are
      zero and it'll try to free them unconditionally. So fix it by checking if
      we're in legacy mode and freeing the appropriate irqs.
      
      CC: Zenghui Shi <zshi@redhat.com>
      CC: Ben Hutchings <ben@decadent.org.uk>
      CC: <linux-net-drivers@solarflare.com>
      CC: Shradha Shah <sshah@solarflare.com>
      CC: David S. Miller <davem@davemloft.net>
      
      Fixes: 1899c111 ("sfc: Fix IRQ cleanup in case of a probe failure")
      Reported-by: default avatarZenghui Shi <zshi@redhat.com>
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ce37c23f
    • Peter Christensen's avatar
      macvlan: Don't propagate IFF_ALLMULTI changes on down interfaces. · 951c8657
      Peter Christensen authored
      [ Upstream commit bbeb0ead ]
      
      Clearing the IFF_ALLMULTI flag on a down interface could cause an allmulti
      overflow on the underlying interface.
      
      Attempting the set IFF_ALLMULTI on the underlying interface would cause an
      error and the log message:
      
      "allmulti touches root, set allmulti failed."
      Signed-off-by: default avatarPeter Christensen <pch@ordbogen.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      951c8657
    • Bjørn Mork's avatar
      net: cdc_mbim: handle unaccelerated VLAN tagged frames · 5cc338cf
      Bjørn Mork authored
      [ Upstream commit 6b5eeb7f ]
      
      This driver maps 802.1q VLANs to MBIM sessions. The mapping is based on
      a bogus assumption that all tagged frames will use the acceleration API
      because we enable NETIF_F_HW_VLAN_CTAG_TX. This fails for e.g. frames
      tagged in userspace using packet sockets. Such frames will erroneously
      be considered as untagged and silently dropped based on not being IP.
      
      Fix by falling back to looking into the ethernet header for a tag if no
      accelerated tag was found.
      
      Fixes: a82c7ce5 ("net: cdc_ncm: map MBIM IPS SessionID to VLAN ID")
      Cc: Greg Suarez <gsuarez@smithmicro.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5cc338cf
    • Sergey Popovich's avatar
      ipv4: fib_semantics: increment fib_info_cnt after fib_info allocation · d4e90595
      Sergey Popovich authored
      [ Upstream commit aeefa1ec ]
      
      Increment fib_info_cnt in fib_create_info() right after successfuly
      alllocating fib_info structure, overwise fib_metrics allocation failure
      leads to fib_info_cnt incorrectly decremented in free_fib_info(), called
      on error path from fib_create_info().
      Signed-off-by: default avatarSergey Popovich <popovich_sergei@mail.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d4e90595
    • Florian Westphal's avatar
      net: ipv6: send pkttoobig immediately if orig frag size > mtu · 156439bd
      Florian Westphal authored
      [ Upstream commit 418a3156 ]
      
      If conntrack defragments incoming ipv6 frags it stores largest original
      frag size in ip6cb and sets ->local_df.
      
      We must thus first test the largest original frag size vs. mtu, and not
      vice versa.
      
      Without this patch PKTTOOBIG is still generated in ip6_fragment() later
      in the stack, but
      
      1) IPSTATS_MIB_INTOOBIGERRORS won't increment
      2) packet did (needlessly) traverse netfilter postrouting hook.
      
      Fixes: fe6cc55f ("net: ip, ipv6: handle gso skbs in forwarding path")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      156439bd
    • Florian Westphal's avatar
      net: ipv4: ip_forward: fix inverted local_df test · b2b68efa
      Florian Westphal authored
      [ Upstream commit ca6c5d4a ]
      
      local_df means 'ignore DF bit if set', so if its set we're
      allowed to perform ip fragmentation.
      
      This wasn't noticed earlier because the output path also drops such skbs
      (and emits needed icmp error) and because netfilter ip defrag did not
      set local_df until couple of days ago.
      
      Only difference is that DF-packets-larger-than MTU now discarded
      earlier (f.e. we avoid pointless netfilter postrouting trip).
      
      While at it, drop the repeated test ip_exceeds_mtu, checking it once
      is enough...
      
      Fixes: fe6cc55f ("net: ip, ipv6: handle gso skbs in forwarding path")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b2b68efa
    • Ying Cai's avatar
      ip_tunnel: Set network header properly for IP_ECN_decapsulate() · 90ca7e93
      Ying Cai authored
      [ Upstream commit e96f2e7c ]
      
      In ip_tunnel_rcv(), set skb->network_header to inner IP header
      before IP_ECN_decapsulate().
      
      Without the fix, IP_ECN_decapsulate() takes outer IP header as
      inner IP header, possibly causing error messages or packet drops.
      
      Note that this skb_reset_network_header() call was in this spot when
      the original feature for checking consistency of ECN bits through
      tunnels was added in eccc1bb8 ("tunnel: drop packet if ECN present
      with not-ECT"). It was only removed from this spot in 3d7b46cd
      ("ip_tunnel: push generic protocol handling to ip_tunnel module.").
      
      Fixes: 3d7b46cd ("ip_tunnel: push generic protocol handling to ip_tunnel module.")
      Reported-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarYing Cai <ycai@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      90ca7e93
    • Andy King's avatar
      vsock: Make transport the proto owner · 368986ee
      Andy King authored
      [ Upstream commit 2c4a336e ]
      
      Right now the core vsock module is the owner of the proto family. This
      means there's nothing preventing the transport module from unloading if
      there are open sockets, which results in a panic. Fix that by allowing
      the transport to be the owner, which will refcount it properly.
      
      Includes version bump to 1.0.1.0-k
      
      Passes checkpatch this time, I swear...
      Acked-by: default avatarDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: default avatarAndy King <acking@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      368986ee
    • Liu Yu's avatar
      tcp_cubic: fix the range of delayed_ack · e78282a5
      Liu Yu authored
      [ Upstream commit 0cda345d ]
      
      commit b9f47a3a (tcp_cubic: limit delayed_ack ratio to prevent
      divide error) try to prevent divide error, but there is still a little
      chance that delayed_ack can reach zero. In case the param cnt get
      negative value, then ratio+cnt would overflow and may happen to be zero.
      As a result, min(ratio, ACK_RATIO_LIMIT) will calculate to be zero.
      
      In some old kernels, such as 2.6.32, there is a bug that would
      pass negative param, which then ultimately leads to this divide error.
      
      commit 5b35e1e6 (tcp: fix tcp_trim_head() to adjust segment count
      with skb MSS) fixed the negative param issue. However,
      it's safe that we fix the range of delayed_ack as well,
      to make sure we do not hit a divide by zero.
      
      CC: Stephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarLiu Yu <allanyuliu@tencent.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e78282a5
    • Vlad Yasevich's avatar
      Revert "macvlan : fix checksums error when we are in bridge mode" · 04adf0fb
      Vlad Yasevich authored
      [ Upstream commit f114890c ]
      
      This reverts commit 12a2856b.
      The commit above doesn't appear to be necessary any more as the
      checksums appear to be correctly computed/validated.
      
      Additionally the above commit breaks kvm configurations where
      one VM is using a device that support checksum offload (virtio) and
      the other VM does not.
      In this case, packets leaving virtio device will have CHECKSUM_PARTIAL
      set.  The packets is forwarded to a macvtap that has offload features
      turned off.  Since we use CHECKSUM_UNNECESSARY, the host does does not
      update the checksum and thus a bad checksum is passed up to
      the guest.
      
      CC: Daniel Lezcano <daniel.lezcano@free.fr>
      CC: Patrick McHardy <kaber@trash.net>
      CC: Andrian Nord <nightnord@gmail.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Jason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      04adf0fb
    • Vlad Yasevich's avatar
      mactap: Fix checksum errors for non-gso packets in bridge mode · e8d41427
      Vlad Yasevich authored
      [ Upstream commit cbdb0427 ]
      
      The following is a problematic configuration:
      
       VM1: virtio-net device connected to macvtap0@eth0
       VM2: e1000 device connect to macvtap1@eth0
      
      The problem is is that virtio-net supports checksum offloading
      and thus sends the packets to the host with CHECKSUM_PARTIAL set.
      On the other hand, e1000 does not support any acceleration.
      
      For small TCP packets (and this includes the 3-way handshake),
      e1000 ends up receiving packets that only have a partial checksum
      set.  This causes TCP to fail checksum validation and to drop
      packets.  As a result tcp connections can not be established.
      
      Commit 3e4f8b78
      	macvtap: Perform GSO on forwarding path.
      fixes this issue for large packets wthat will end up undergoing GSO.
      This commit adds a check for the non-GSO case and attempts to
      compute the checksum for partially checksummed packets in the
      non-GSO case.
      
      CC: Daniel Lezcano <daniel.lezcano@free.fr>
      CC: Patrick McHardy <kaber@trash.net>
      CC: Andrian Nord <nightnord@gmail.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Jason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e8d41427
    • Oliver Hartkopp's avatar
      slip: fix spinlock variant · 742bc1c6
      Oliver Hartkopp authored
      [ Upstream commit ddcde142 ]
      
      With commit cc9fa74e ("slip/slcan: added locking in wakeup function") a
      formerly missing locking was added to slip.c and slcan.c by Andre Naujoks.
      
      Alexander Stein contributed the fix 367525c8 ("can: slcan: Fix spinlock
      variant") as the kernel lock debugging advised to use spin_lock_bh() instead
      of just using spin_lock().
      
      This fix has to be applied to the same code section in slip.c for the same
      reason too.
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      742bc1c6
    • Bjørn Mork's avatar
      net: qmi_wwan: add a number of Dell devices · 692e923e
      Bjørn Mork authored
      [ Upstream commit 6f10c5d1 ]
      
      Dan writes:
      
      "The Dell drivers use the same configuration for PIDs:
      
      81A2: Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card
      81A3: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card
      81A4: Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card
      81A8: Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card
      81A9: Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card
      
      These devices are all clearly Sierra devices, but are also definitely
      Gobi-based.  The A8 might be the MC7700/7710 and A9 is likely a MC7750.
      
      >From DellGobi5kSetup.exe from the Dell drivers:
      
      usbif0: serial/firmware loader?
      usbif2: nmea
      usbif3: modem/ppp
      usbif8: net/QMI"
      Reported-by: default avatarAceLan Kao <acelan.kao@canonical.com>
      Reported-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      692e923e
    • Bjørn Mork's avatar
      net: qmi_wwan: add a number of CMOTech devices · 66bafbb2
      Bjørn Mork authored
      [ Upstream commit 41be7d90 ]
      
      A number of older CMOTech modems are based on Qualcomm
      chips and exporting a QMI/wwan function.
      Reported-by: default avatarLars Melin <larsm17@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      66bafbb2
    • Bjørn Mork's avatar
      net: qmi_wwan: add Alcatel L800MA · ea942a5c
      Bjørn Mork authored
      [ Upstream commit 75573660 ]
      
      Device interface layout:
      0: ff/ff/ff - serial
      1: ff/00/00 - serial AT+PPP
      2: ff/ff/ff - QMI/wwan
      3: 08/06/50 - storage
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ea942a5c
    • Bjørn Mork's avatar
      net: qmi_wwan: add Olivetti Olicard 500 · 39e5bd5d
      Bjørn Mork authored
      [ Upstream commit efc0b25c ]
      
      Device interface layout:
      0: ff/ff/ff - serial
      1: ff/ff/ff - serial AT+PPP
      2: 08/06/50 - storage
      3: ff/ff/ff - serial
      4: ff/ff/ff - QMI/wwan
      Reported-by: default avatarJulio Araujo <julio.araujo@wllctel.com.br>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      39e5bd5d
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless MC7305/MC7355 · f4d5e369
      Bjørn Mork authored
      [ Upstream commit 9214224e ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f4d5e369
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless MC73xx · d2945a5a
      Bjørn Mork authored
      [ Upstream commit 1c138607 ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d2945a5a
    • Bjørn Mork's avatar
      net: qmi_wwan: add Sierra Wireless EM7355 · 728d25ed
      Bjørn Mork authored
      [ Upstream commit b85f5dea ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      728d25ed
    • Xufeng Zhang's avatar
      sctp: reset flowi4_oif parameter on route lookup · 90f00d5d
      Xufeng Zhang authored
      [ Upstream commit 85350871 ]
      
      commit 813b3b5d (ipv4: Use caller's on-stack flowi as-is
      in output route lookups.) introduces another regression which
      is very similar to the problem of commit e6b45241 (ipv4: reset
      flowi parameters on route connect) wants to fix:
      Before we call ip_route_output_key() in sctp_v4_get_dst() to
      get a dst that matches a bind address as the source address,
      we have already called this function previously and the flowi
      parameters have been initialized including flowi4_oif, so when
      we call this function again, the process in __ip_route_output_key()
      will be different because of the setting of flowi4_oif, and we'll
      get a networking device which corresponds to the inputted flowi4_oif
      as the output device, this is wrong because we'll never hit this
      place if the previously returned source address of dst match one
      of the bound addresses.
      
      To reproduce this problem, a vlan setting is enough:
        # ifconfig eth0 up
        # route del default
        # vconfig add eth0 2
        # vconfig add eth0 3
        # ifconfig eth0.2 10.0.1.14 netmask 255.255.255.0
        # route add default gw 10.0.1.254 dev eth0.2
        # ifconfig eth0.3 10.0.0.14 netmask 255.255.255.0
        # ip rule add from 10.0.0.14 table 4
        # ip route add table 4 default via 10.0.0.254 src 10.0.0.14 dev eth0.3
        # sctp_darn -H 10.0.0.14 -P 36422 -h 10.1.4.134 -p 36422 -s -I
      You'll detect that all the flow are routed to eth0.2(10.0.1.254).
      Signed-off-by: default avatarXufeng Zhang <xufeng.zhang@windriver.com>
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      90f00d5d
    • Toshiaki Makita's avatar
      bridge: Handle IFLA_ADDRESS correctly when creating bridge device · c07ff541
      Toshiaki Makita authored
      [ Upstream commit 30313a3d ]
      
      When bridge device is created with IFLA_ADDRESS, we are not calling
      br_stp_change_bridge_id(), which leads to incorrect local fdb
      management and bridge id calculation, and prevents us from receiving
      frames on the bridge device.
      Reported-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c07ff541
    • Kumar Sundararajan's avatar
      ipv6: fib: fix fib dump restart · f0b511ca
      Kumar Sundararajan authored
      [ Upstream commit 1c265854 ]
      
      When the ipv6 fib changes during a table dump, the walk is
      restarted and the number of nodes dumped are skipped. But the existing
      code doesn't advance to the next node after a node is skipped. This can
      cause the dump to loop or produce lots of duplicates when the fib
      is modified during the dump.
      
      This change advances the walk to the next node if the current node is
      skipped after a restart.
      Signed-off-by: default avatarKumar Sundararajan <kumar@fb.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f0b511ca
    • David Gibson's avatar
      rtnetlink: Only supply IFLA_VF_PORTS information when RTEXT_FILTER_VF is set · e63f88ce
      David Gibson authored
      [ Upstream commit c53864fd ]
      
      Since 115c9b81 (rtnetlink: Fix problem with
      buffer allocation), RTM_NEWLINK messages only contain the IFLA_VFINFO_LIST
      attribute if they were solicited by a GETLINK message containing an
      IFLA_EXT_MASK attribute with the RTEXT_FILTER_VF flag.
      
      That was done because some user programs broke when they received more data
      than expected - because IFLA_VFINFO_LIST contains information for each VF
      it can become large if there are many VFs.
      
      However, the IFLA_VF_PORTS attribute, supplied for devices which implement
      ndo_get_vf_port (currently the 'enic' driver only), has the same problem.
      It supplies per-VF information and can therefore become large, but it is
      not currently conditional on the IFLA_EXT_MASK value.
      
      Worse, it interacts badly with the existing EXT_MASK handling.  When
      IFLA_EXT_MASK is not supplied, the buffer for netlink replies is fixed at
      NLMSG_GOODSIZE.  If the information for IFLA_VF_PORTS exceeds this, then
      rtnl_fill_ifinfo() returns -EMSGSIZE on the first message in a packet.
      netlink_dump() will misinterpret this as having finished the listing and
      omit data for this interface and all subsequent ones.  That can cause
      getifaddrs(3) to enter an infinite loop.
      
      This patch addresses the problem by only supplying IFLA_VF_PORTS when
      IFLA_EXT_MASK is supplied with the RTEXT_FILTER_VF flag set.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e63f88ce
    • David Gibson's avatar
      rtnetlink: Warn when interface's information won't fit in our packet · 5a6aea7c
      David Gibson authored
      [ Upstream commit 973462bb ]
      
      Without IFLA_EXT_MASK specified, the information reported for a single
      interface in response to RTM_GETLINK is expected to fit within a netlink
      packet of NLMSG_GOODSIZE.
      
      If it doesn't, however, things will go badly wrong,  When listing all
      interfaces, netlink_dump() will incorrectly treat -EMSGSIZE on the first
      message in a packet as the end of the listing and omit information for
      that interface and all subsequent ones.  This can cause getifaddrs(3) to
      enter an infinite loop.
      
      This patch won't fix the problem, but it will WARN_ON() making it easier to
      track down what's going wrong.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarJiri Pirko <jpirko@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5a6aea7c
    • Andrew Lutomirski's avatar
      net: Fix ns_capable check in sock_diag_put_filterinfo · 6bebcc8d
      Andrew Lutomirski authored
      [ Upstream commit 78541c1d ]
      
      The caller needs capabilities on the namespace being queried, not on
      their own namespace.  This is a security bug, although it likely has
      only a minor impact.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6bebcc8d
    • Vlad Yasevich's avatar
      net: sctp: cache auth_enable per endpoint · 88830f22
      Vlad Yasevich authored
      [ Upstream commit b14878cc ]
      
      Currently, it is possible to create an SCTP socket, then switch
      auth_enable via sysctl setting to 1 and crash the system on connect:
      
      Oops[#1]:
      CPU: 0 PID: 0 Comm: swapper Not tainted 3.14.1-mipsgit-20140415 #1
      task: ffffffff8056ce80 ti: ffffffff8055c000 task.ti: ffffffff8055c000
      [...]
      Call Trace:
      [<ffffffff8043c4e8>] sctp_auth_asoc_set_default_hmac+0x68/0x80
      [<ffffffff8042b300>] sctp_process_init+0x5e0/0x8a4
      [<ffffffff8042188c>] sctp_sf_do_5_1B_init+0x234/0x34c
      [<ffffffff804228c8>] sctp_do_sm+0xb4/0x1e8
      [<ffffffff80425a08>] sctp_endpoint_bh_rcv+0x1c4/0x214
      [<ffffffff8043af68>] sctp_rcv+0x588/0x630
      [<ffffffff8043e8e8>] sctp6_rcv+0x10/0x24
      [<ffffffff803acb50>] ip6_input+0x2c0/0x440
      [<ffffffff8030fc00>] __netif_receive_skb_core+0x4a8/0x564
      [<ffffffff80310650>] process_backlog+0xb4/0x18c
      [<ffffffff80313cbc>] net_rx_action+0x12c/0x210
      [<ffffffff80034254>] __do_softirq+0x17c/0x2ac
      [<ffffffff800345e0>] irq_exit+0x54/0xb0
      [<ffffffff800075a4>] ret_from_irq+0x0/0x4
      [<ffffffff800090ec>] rm7k_wait_irqoff+0x24/0x48
      [<ffffffff8005e388>] cpu_startup_entry+0xc0/0x148
      [<ffffffff805a88b0>] start_kernel+0x37c/0x398
      Code: dd0900b8  000330f8  0126302d <dcc60000> 50c0fff1  0047182a  a48306a0
      03e00008  00000000
      ---[ end trace b530b0551467f2fd ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      What happens while auth_enable=0 in that case is, that
      ep->auth_hmacs is initialized to NULL in sctp_auth_init_hmacs()
      when endpoint is being created.
      
      After that point, if an admin switches over to auth_enable=1,
      the machine can crash due to NULL pointer dereference during
      reception of an INIT chunk. When we enter sctp_process_init()
      via sctp_sf_do_5_1B_init() in order to respond to an INIT chunk,
      the INIT verification succeeds and while we walk and process
      all INIT params via sctp_process_param() we find that
      net->sctp.auth_enable is set, therefore do not fall through,
      but invoke sctp_auth_asoc_set_default_hmac() instead, and thus,
      dereference what we have set to NULL during endpoint
      initialization phase.
      
      The fix is to make auth_enable immutable by caching its value
      during endpoint initialization, so that its original value is
      being carried along until destruction. The bug seems to originate
      from the very first days.
      
      Fix in joint work with Daniel Borkmann.
      Reported-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Tested-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      88830f22
    • Ivan Vecera's avatar
      tg3: update rx_jumbo_pending ring param only when jumbo frames are enabled · 6341e247
      Ivan Vecera authored
      The patch fixes a problem with dropped jumbo frames after usage of
      'ethtool -G ... rx'.
      
      Scenario:
      1. ip link set eth0 up
      2. ethtool -G eth0 rx N # <- This zeroes rx-jumbo
      3. ip link set mtu 9000 dev eth0
      
      The ethtool command set rx_jumbo_pending to zero so any received jumbo
      packets are dropped and you need to use 'ethtool -G eth0 rx-jumbo N'
      to workaround the issue.
      The patch changes the logic so rx_jumbo_pending value is changed only if
      jumbo frames are enabled (MTU > 1500).
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Acked-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6341e247
    • dingtianhong's avatar
      vlan: Fix lockdep warning when vlan dev handle notification · 059590c8
      dingtianhong authored
      [ Upstream commit dc8eaaa0 ]
      
      When I open the LOCKDEP config and run these steps:
      
      modprobe 8021q
      vconfig add eth2 20
      vconfig add eth2.20 30
      ifconfig eth2 xx.xx.xx.xx
      
      then the Call Trace happened:
      
      [32524.386288] =============================================
      [32524.386293] [ INFO: possible recursive locking detected ]
      [32524.386298] 3.14.0-rc2-0.7-default+ #35 Tainted: G           O
      [32524.386302] ---------------------------------------------
      [32524.386306] ifconfig/3103 is trying to acquire lock:
      [32524.386310]  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff814275f4>] dev_mc_sync+0x64/0xb0
      [32524.386326]
      [32524.386326] but task is already holding lock:
      [32524.386330]  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff8141af83>] dev_set_rx_mode+0x23/0x40
      [32524.386341]
      [32524.386341] other info that might help us debug this:
      [32524.386345]  Possible unsafe locking scenario:
      [32524.386345]
      [32524.386350]        CPU0
      [32524.386352]        ----
      [32524.386354]   lock(&vlan_netdev_addr_lock_key/1);
      [32524.386359]   lock(&vlan_netdev_addr_lock_key/1);
      [32524.386364]
      [32524.386364]  *** DEADLOCK ***
      [32524.386364]
      [32524.386368]  May be due to missing lock nesting notation
      [32524.386368]
      [32524.386373] 2 locks held by ifconfig/3103:
      [32524.386376]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81431d42>] rtnl_lock+0x12/0x20
      [32524.386387]  #1:  (&vlan_netdev_addr_lock_key/1){+.....}, at: [<ffffffff8141af83>] dev_set_rx_mode+0x23/0x40
      [32524.386398]
      [32524.386398] stack backtrace:
      [32524.386403] CPU: 1 PID: 3103 Comm: ifconfig Tainted: G           O 3.14.0-rc2-0.7-default+ #35
      [32524.386409] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
      [32524.386414]  ffffffff81ffae40 ffff8800d9625ae8 ffffffff814f68a2 ffff8800d9625bc8
      [32524.386421]  ffffffff810a35fb ffff8800d8a8d9d0 00000000d9625b28 ffff8800d8a8e5d0
      [32524.386428]  000003cc00000000 0000000000000002 ffff8800d8a8e5f8 0000000000000000
      [32524.386435] Call Trace:
      [32524.386441]  [<ffffffff814f68a2>] dump_stack+0x6a/0x78
      [32524.386448]  [<ffffffff810a35fb>] __lock_acquire+0x7ab/0x1940
      [32524.386454]  [<ffffffff810a323a>] ? __lock_acquire+0x3ea/0x1940
      [32524.386459]  [<ffffffff810a4874>] lock_acquire+0xe4/0x110
      [32524.386464]  [<ffffffff814275f4>] ? dev_mc_sync+0x64/0xb0
      [32524.386471]  [<ffffffff814fc07a>] _raw_spin_lock_nested+0x2a/0x40
      [32524.386476]  [<ffffffff814275f4>] ? dev_mc_sync+0x64/0xb0
      [32524.386481]  [<ffffffff814275f4>] dev_mc_sync+0x64/0xb0
      [32524.386489]  [<ffffffffa0500cab>] vlan_dev_set_rx_mode+0x2b/0x50 [8021q]
      [32524.386495]  [<ffffffff8141addf>] __dev_set_rx_mode+0x5f/0xb0
      [32524.386500]  [<ffffffff8141af8b>] dev_set_rx_mode+0x2b/0x40
      [32524.386506]  [<ffffffff8141b3cf>] __dev_open+0xef/0x150
      [32524.386511]  [<ffffffff8141b177>] __dev_change_flags+0xa7/0x190
      [32524.386516]  [<ffffffff8141b292>] dev_change_flags+0x32/0x80
      [32524.386524]  [<ffffffff8149ca56>] devinet_ioctl+0x7d6/0x830
      [32524.386532]  [<ffffffff81437b0b>] ? dev_ioctl+0x34b/0x660
      [32524.386540]  [<ffffffff814a05b0>] inet_ioctl+0x80/0xa0
      [32524.386550]  [<ffffffff8140199d>] sock_do_ioctl+0x2d/0x60
      [32524.386558]  [<ffffffff81401a52>] sock_ioctl+0x82/0x2a0
      [32524.386568]  [<ffffffff811a7123>] do_vfs_ioctl+0x93/0x590
      [32524.386578]  [<ffffffff811b2705>] ? rcu_read_lock_held+0x45/0x50
      [32524.386586]  [<ffffffff811b39e5>] ? __fget_light+0x105/0x110
      [32524.386594]  [<ffffffff811a76b1>] SyS_ioctl+0x91/0xb0
      [32524.386604]  [<ffffffff815057e2>] system_call_fastpath+0x16/0x1b
      
      ========================================================================
      
      The reason is that all of the addr_lock_key for vlan dev have the same class,
      so if we change the status for vlan dev, the vlan dev and its real dev will
      hold the same class of addr_lock_key together, so the warning happened.
      
      we should distinguish the lock depth for vlan dev and its real dev.
      
      v1->v2: Convert the vlan_netdev_addr_lock_key to an array of eight elements, which
      	could support to add 8 vlan id on a same vlan dev, I think it is enough for current
      	scene, because a netdev's name is limited to IFNAMSIZ which could not hold 8 vlan id,
      	and the vlan dev would not meet the same class key with its real dev.
      
      	The new function vlan_dev_get_lockdep_subkey() will return the subkey and make the vlan
      	dev could get a suitable class key.
      
      v2->v3: According David's suggestion, I use the subclass to distinguish the lock key for vlan dev
      	and its real dev, but it make no sense, because the difference for subclass in the
      	lock_class_key doesn't mean that the difference class for lock_key, so I use lock_depth
      	to distinguish the different depth for every vlan dev, the same depth of the vlan dev
      	could have the same lock_class_key, I import the MAX_LOCK_DEPTH from the include/linux/sched.h,
      	I think it is enough here, the lockdep should never exceed that value.
      
      v3->v4: Add a huge array of locking keys will waste static kernel memory and is not a appropriate method,
      	we could use _nested() variants to fix the problem, calculate the depth for every vlan dev,
      	and use the depth as the subclass for addr_lock_key.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      059590c8
    • Nicolas Dichtel's avatar
      ip6_gre: don't allow to remove the fb_tunnel_dev · 3565e185
      Nicolas Dichtel authored
      [ Upstream commit 54d63f78 ]
      
      It's possible to remove the FB tunnel with the command 'ip link del ip6gre0' but
      this is unsafe, the module always supposes that this device exists. For example,
      ip6gre_tunnel_lookup() may use it unconditionally.
      
      Let's add a rtnl handler for dellink, which will never remove the FB tunnel (we
      let ip6gre_destroy_tunnels() do the job).
      
      Introduced by commit c12b395a ("gre: Support GRE over IPv6").
      
      CC: Dmitry Kozlov <xeb@mail.ru>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3565e185
    • Mathias Krause's avatar
      filter: prevent nla extensions to peek beyond the end of the message · dd6e370c
      Mathias Krause authored
      [ Upstream commit 05ab8f26 ]
      
      The BPF_S_ANC_NLATTR and BPF_S_ANC_NLATTR_NEST extensions fail to check
      for a minimal message length before testing the supplied offset to be
      within the bounds of the message. This allows the subtraction of the nla
      header to underflow and therefore -- as the data type is unsigned --
      allowing far to big offset and length values for the search of the
      netlink attribute.
      
      The remainder calculation for the BPF_S_ANC_NLATTR_NEST extension is
      also wrong. It has the minuend and subtrahend mixed up, therefore
      calculates a huge length value, allowing to overrun the end of the
      message while looking for the netlink attribute.
      
      The following three BPF snippets will trigger the bugs when attached to
      a UNIX datagram socket and parsing a message with length 1, 2 or 3.
      
       ,-[ PoC for missing size check in BPF_S_ANC_NLATTR ]--
       | ld	#0x87654321
       | ldx	#42
       | ld	#nla
       | ret	a
       `---
      
       ,-[ PoC for the same bug in BPF_S_ANC_NLATTR_NEST ]--
       | ld	#0x87654321
       | ldx	#42
       | ld	#nlan
       | ret	a
       `---
      
       ,-[ PoC for wrong remainder calculation in BPF_S_ANC_NLATTR_NEST ]--
       | ; (needs a fake netlink header at offset 0)
       | ld	#0
       | ldx	#42
       | ld	#nlan
       | ret	a
       `---
      
      Fix the first issue by ensuring the message length fulfills the minimal
      size constrains of a nla header. Fix the second bug by getting the math
      for the remainder calculation right.
      
      Fixes: 4738c1db ("[SKFILTER]: Add SKF_ADF_NLATTR instruction")
      Fixes: d214c753 ("filter: add SKF_AD_NLATTR_NEST to look for nested..")
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      dd6e370c
    • Julian Anastasov's avatar
      ipv4: return valid RTA_IIF on ip route get · d3fe9147
      Julian Anastasov authored
      [ Upstream commit 91146153 ]
      
      Extend commit 13378cad
      ("ipv4: Change rt->rt_iif encoding.") from 3.6 to return valid
      RTA_IIF on 'ip route get ... iif DEVICE' instead of rt_iif 0
      which is displayed as 'iif *'.
      
      inet_iif is not appropriate to use because skb_iif is not set.
      Use the skb->dev->ifindex instead.
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d3fe9147