1. 11 May, 2016 8 commits
    • Joe Stringer's avatar
      openvswitch: Fix cached ct with helper. · 16ec3d4f
      Joe Stringer authored
      When using conntrack helpers from OVS, a common configuration is to
      perform a lookup without specifying a helper, then go through a
      firewalling policy, only to decide to attach a helper afterwards.
      
      In this case, the initial lookup will cause a ct entry to be attached to
      the skb, then the later commit with helper should attach the helper and
      confirm the connection. However, the helper attachment has been missing.
      If the user has enabled automatic helper attachment, then this issue
      will be masked as it will be applied in init_conntrack(). It is also
      masked if the action is executed from ovs_packet_cmd_execute() as that
      will construct a fresh skb.
      
      This patch fixes the issue by making an explicit call to try to assign
      the helper if there is a discrepancy between the action's helper and the
      current skb->nfct.
      
      Fixes: cae3a262 ("openvswitch: Allow attaching helpers to ct action")
      Signed-off-by: default avatarJoe Stringer <joe@ovn.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16ec3d4f
    • David S. Miller's avatar
      Merge branch 'net-sched-fixes' · 6e14313f
      David S. Miller authored
      Jamal Hadi Salim says:
      
      ====================
      Some actions were broken in allowing for late binding of actions.
      Late binding workflow is as follows:
      a) create an action and provide all necessary parameters for it
      Optionally provide an index or let the kernel give you one.
      Example:
      sudo tc actions add action police rate 1kbit burst 90k drop index 1
      
      b) later on bind to the pre-created action from a filter definition
      by merely specifying the index.
      Example:
      sudo tc filter add dev lo parent ffff: protocol ip prio 8 \
      u32 match ip src 127.0.0.8/32 flowid 1:8 action police index 1
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e14313f
    • Jamal Hadi Salim's avatar
      net sched: ife action fix late binding · 4e8c8615
      Jamal Hadi Salim authored
      The process below was broken and is fixed with this patch.
      
      //add an ife action and give it an instance id of 1
      sudo tc actions add action ife encode \
      type 0xDEAD allow mark dst 02:15:15:15:15:15 index 1
      
      //create a filter which binds to ife action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32\
      match ip dst 17.0.0.1/32 flowid 1:11 action ife index 1
      
      Message before fix was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e8c8615
    • Jamal Hadi Salim's avatar
      net sched: skbedit action fix late binding · 5e1567ae
      Jamal Hadi Salim authored
      The process below was broken and is fixed with this patch.
      
      //add a skbedit action and give it an instance id of 1
      sudo tc actions add action skbedit mark 10 index 1
      //create a filter which binds to skbedit action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32\
      match ip dst 17.0.0.1/32 flowid 1:10 action skbedit index 1
      
      Message before fix was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e1567ae
    • Jamal Hadi Salim's avatar
      net sched: simple action fix late binding · 0e5538ab
      Jamal Hadi Salim authored
      The process below was broken and is fixed with this patch.
      
      //add a simple action and give it an instance id of 1
      sudo tc actions add action simple sdata "foobar" index 1
      //create a filter which binds to simple action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32\
      match ip dst 17.0.0.1/32 flowid 1:10 action simple index 1
      
      Message before fix was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e5538ab
    • Jamal Hadi Salim's avatar
      net sched: mirred action fix late binding · 87dfbdc6
      Jamal Hadi Salim authored
      The process below was broken and is fixed with this patch.
      
      //add an mirred action and give it an instance id of 1
      sudo tc actions add action mirred egress mirror dev $MDEV  index 1
      //create a filter which binds to mirred action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32\
      match ip dst 17.0.0.1/32 flowid 1:10 action mirred index 1
      
      Message before bug fix was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87dfbdc6
    • Jamal Hadi Salim's avatar
      net sched: ipt action fix late binding · a57f19d3
      Jamal Hadi Salim authored
      This was broken and is fixed with this patch.
      
      //add an ipt action and give it an instance id of 1
      sudo tc actions add action ipt -j mark --set-mark 2 index 1
      //create a filter which binds to ipt action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32\
      match ip dst 17.0.0.1/32 flowid 1:10 action ipt index 1
      
      Message before bug fix was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a57f19d3
    • Jamal Hadi Salim's avatar
      net sched: vlan action fix late binding · 5026c9b1
      Jamal Hadi Salim authored
      Late vlan action binding was broken and is fixed with this patch.
      
      //add a vlan action to pop and give it an instance id of 1
      sudo tc actions add action vlan pop index 1
      //create filter which binds to vlan action id 1
      sudo tc filter add dev $DEV parent ffff: protocol ip prio 1 u32 \
      match ip dst 17.0.0.1/32 flowid 1:1 action vlan index 1
      
      current message(before bug fix) was:
      RTNETLINK answers: Invalid argument
      We have an error talking to the kernel
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5026c9b1
  2. 10 May, 2016 12 commits
    • Shaohui Xie's avatar
      net: phylib: fix interrupts re-enablement in phy_start · 84a527a4
      Shaohui Xie authored
      If phy was suspended and is starting, current driver always enable
      phy's interrupts, if phy works in polling, phy can raise unexpected
      interrupt which will not be handled, the interrupt will block system
      enter suspend again. So interrupts should only be re-enabled if phy
      works in interrupt.
      Signed-off-by: default avatarShaohui Xie <Shaohui.Xie@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84a527a4
    • Eric Dumazet's avatar
      tcp: refresh skb timestamp at retransmit time · 10a81980
      Eric Dumazet authored
      In the very unlikely case __tcp_retransmit_skb() can not use the cloning
      done in tcp_transmit_skb(), we need to refresh skb_mstamp before doing
      the copy and transmit, otherwise TCP TS val will be an exact copy of
      original transmit.
      
      Fixes: 7faee5c0 ("tcp: remove TCP_SKB_CB(skb)->when")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Acked-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      10a81980
    • David S. Miller's avatar
      Merge branch 'nps_enet-fixes' · 3b0d190a
      David S. Miller authored
      Elad Kanfi says:
      
      ====================
      nps_enet: Net driver bugs fix
      
      v3:
      tx_packet_sent flag is not necessary, use socket buffer pointer
      instead.
      Use wmb() instead of smp_wmb().
      
      v2:
      Remove code style commit for now.
      Code style commit will be added after the bugs fix will be approved.
      
      Summary:
       1. Bug description: TX done interrupts that arrives while interrupts
          are masked, during NAPI poll, will not trigger an interrupt handling.
          Since TX interrupt is of level edge we will lose the TX done interrupt.
          As a result all pending tx frames will get no service.
      
          Solution: Check if there is a pending tx request after unmasking the
          interrupt and if answer is yes then re-add ourselves to
          the NAPI poll list.
      
       2. Bug description: CPU-A before sending a frame will set a variable
          to true. CPU-B that executes the tx done interrupt service routine
          might read a non valid value of that variable.
      
          Solution: Use the socket buffer pointer instead of the variable,
          and add a write memory barrier at the tx sending function after
          the pointer is set.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b0d190a
    • Elad Kanfi's avatar
      net: nps_enet: bug fix - handle lost tx interrupts · 05c00d82
      Elad Kanfi authored
      The tx interrupt is of edge type, and in case such interrupt is triggered
      while it is masked it will not be handled even after tx interrupts are
      re-enabled in the end of NAPI poll.
      This will cause tx network to stop in the following scenario:
       * Rx is being handled, hence interrupts are masked.
       * Tx interrupt is triggered after checking if there is some tx to handle
         and before re-enabling the interrupts.
      In this situation only rx transaction will release tx requests.
      
      In order to handle the tx that was missed( if there was one ),
      a NAPI reschdule was added after enabling the interrupts.
      Signed-off-by: default avatarElad Kanfi <eladkan@mellanox.com>
      Acked-by: default avatarNoam Camus <noamca@mellanox.com>
      Acked-by: default avatarGilad Ben-Yossef <giladby@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05c00d82
    • Elad Kanfi's avatar
      net: nps_enet: Tx handler synchronization · e5df49d5
      Elad Kanfi authored
      Below is a description of a possible problematic
      sequence. CPU-A is sending a frame and CPU-B handles
      the interrupt that indicates the frame was sent. CPU-B
      reads an invalid value of tx_packet_sent.
      
      	CPU-A				CPU-B
      	-----				-----
      	nps_enet_send_frame
      	.
      	.
      	tx_skb = skb
      	tx_packet_sent = true
      	order HW to start tx
      	.
      	.
      	HW complete tx
      			    ------> 	get tx complete interrupt
      					.
      					.
      					if(tx_packet_sent == true)
      						handle tx_skb
      
      	end memory transaction
      	(tx_packet_sent actually
      	 written)
      
      Furthermore there is a dependency between tx_skb and tx_packet_sent.
      There is no assurance that tx_skb contains a valid pointer at CPU B
      when it sees tx_packet_sent == true.
      
      Solution:
      
      Initialize tx_skb to NULL and use it to indicate that packet was sent,
      in this way tx_packet_sent can be removed.
      Add a write memory barrier after setting tx_skb in order to make sure
      that it is valid before HW is informed and IRQ is fired.
      
      Fixed sequence will be:
      
             CPU-A                           CPU-B
             -----                           -----
      
      	tx_skb = skb
      	wmb()
      	.
      	.
      	order HW to start tx
      	.
      	.
      	HW complete tx
      			------>		get tx complete interrupt
      					.
      					.
      					if(tx_skb != NULL)
      						handle tx_skb
      
      					tx_skb = NULL
      Signed-off-by: default avatarElad Kanfi <eladkan@mellanox.com>
      Acked-by: default avatarNoam Camus <noamca@mellanox.com>
      Acked-by: default avatarGilad Ben-Yossef <giladby@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5df49d5
    • Jamal Hadi Salim's avatar
      export tc ife uapi header · d99079e2
      Jamal Hadi Salim authored
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d99079e2
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-for-davem-2016-05-09' of... · 5e769ada
      David S. Miller authored
      Merge tag 'wireless-drivers-for-davem-2016-05-09' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for 4.6
      
      iwlwifi
      
      * fix P2P rates (and possibly other issues)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e769ada
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · adc0a8bf
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contain Netfilter simple fixes for your net tree,
      two one-liner and one two-liner:
      
      1) Oneliner to fix missing spinlock definition that triggers
         'BUG: spinlock bad magic on CPU#' when spinlock debugging is enabled,
         from Florian Westphal.
      
      2) Fix missing workqueue cancelation on IDLETIMER removal,
         from Liping Zhang.
      
      3) Fix insufficient validation of netlink of NFACCT_QUOTA in
         nfnetlink_acct, from Phil Turnbull.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      adc0a8bf
    • xypron.glpk@gmx.de's avatar
      net: thunderx: avoid exposing kernel stack · 161de2ca
      xypron.glpk@gmx.de authored
      Reserved fields should be set to zero to avoid exposing
      bits from the kernel stack.
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      161de2ca
    • Kangjie Lu's avatar
      net: fix a kernel infoleak in x25 module · 79e48650
      Kangjie Lu authored
      Stack object "dte_facilities" is allocated in x25_rx_call_request(),
      which is supposed to be initialized in x25_negotiate_facilities.
      However, 5 fields (8 bytes in total) are not initialized. This
      object is then copied to userland via copy_to_user, thus infoleak
      occurs.
      Signed-off-by: default avatarKangjie Lu <kjlu@gatech.edu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79e48650
    • Geert Uytterhoeven's avatar
      ravb: Add missing free_irq() call to ravb_close() · 7fa816b9
      Geert Uytterhoeven authored
      When reopening the network device on ra7795/salvator-x, e.g. after a
      DHCP timeout:
      
          IP-Config: Reopening network devices...
          genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (eth0:ch24:emac)
          ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
          IP-Config: Failed to open eth0
          IP-Config: No network devices available
      
      The "mismatch" is due to requesting an IRQ that is already in use,
      while IRQF_PROBE_SHARED wasn't set.
      
      However, the real cause is that ravb_close() doesn't release the R-Car
      Gen3-specific secondary IRQ.
      
      Add the missing free_irq() call to fix this.
      
      Fixes: 22d4df8f ("ravb: Add support for r8a7795 SoC")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7fa816b9
    • Mikko Rapeli's avatar
      uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h · 4a91cb61
      Mikko Rapeli authored
      glibc's net/if.h contains copies of definitions from linux/if.h and these
      conflict and cause build failures if both files are included by application
      source code. Changes in uapi headers, which fixed header file dependencies to
      include linux/if.h when it was needed, e.g. commit 1ffad83d, made the
      net/if.h and linux/if.h incompatibilities visible as build failures for
      userspace applications like iproute2 and xtables-addons.
      
      This patch fixes compile errors when glibc net/if.h is included before
      linux/if.h:
      
      ./linux/if.h:99:21: error: redeclaration of enumerator ‘IFF_NOARP’
      ./linux/if.h:98:23: error: redeclaration of enumerator ‘IFF_RUNNING’
      ./linux/if.h:97:26: error: redeclaration of enumerator ‘IFF_NOTRAILERS’
      ./linux/if.h:96:27: error: redeclaration of enumerator ‘IFF_POINTOPOINT’
      ./linux/if.h:95:24: error: redeclaration of enumerator ‘IFF_LOOPBACK’
      ./linux/if.h:94:21: error: redeclaration of enumerator ‘IFF_DEBUG’
      ./linux/if.h:93:25: error: redeclaration of enumerator ‘IFF_BROADCAST’
      ./linux/if.h:92:19: error: redeclaration of enumerator ‘IFF_UP’
      ./linux/if.h:252:8: error: redefinition of ‘struct ifconf’
      ./linux/if.h:203:8: error: redefinition of ‘struct ifreq’
      ./linux/if.h:169:8: error: redefinition of ‘struct ifmap’
      ./linux/if.h:107:23: error: redeclaration of enumerator ‘IFF_DYNAMIC’
      ./linux/if.h:106:25: error: redeclaration of enumerator ‘IFF_AUTOMEDIA’
      ./linux/if.h:105:23: error: redeclaration of enumerator ‘IFF_PORTSEL’
      ./linux/if.h:104:25: error: redeclaration of enumerator ‘IFF_MULTICAST’
      ./linux/if.h:103:21: error: redeclaration of enumerator ‘IFF_SLAVE’
      ./linux/if.h:102:22: error: redeclaration of enumerator ‘IFF_MASTER’
      ./linux/if.h:101:24: error: redeclaration of enumerator ‘IFF_ALLMULTI’
      ./linux/if.h:100:23: error: redeclaration of enumerator ‘IFF_PROMISC’
      
      The cases where linux/if.h is included before net/if.h need a similar fix in
      the glibc side, or the order of include files can be changed userspace
      code as a workaround.
      
      This change was tested in x86 userspace on Debian unstable with
      scripts/headers_compile_test.sh:
      
      $ make headers_install && \
        cd usr/include && ../../scripts/headers_compile_test.sh -l -k
      ...
      cc -Wall -c -nostdinc -I /usr/lib/gcc/i586-linux-gnu/5/include -I /usr/lib/gcc/i586-linux-gnu/5/include-fixed -I . -I /home/mcfrisk/src/linux-2.6/usr/headers_compile_test_include.2uX2zH -I /home/mcfrisk/src/linux-2.6/usr/headers_compile_test_include.2uX2zH/i586-linux-gnu -o /dev/null ./linux/if.h_libc_before_kernel.h
      PASSED libc before kernel test: ./linux/if.h
      Reported-by: default avatarJan Engelhardt <jengelh@inai.de>
      Reported-by: default avatarJosh Boyer <jwboyer@fedoraproject.org>
      Reported-by: default avatarStephen Hemminger <shemming@brocade.com>
      Reported-by: default avatarWaldemar Brodkorb <mail@waldemar-brodkorb.de>
      Cc: Gabriel Laskar <gabriel@lse.epita.fr>
      Signed-off-by: default avatarMikko Rapeli <mikko.rapeli@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a91cb61
  3. 09 May, 2016 11 commits
  4. 08 May, 2016 1 commit
  5. 07 May, 2016 8 commits