1. 11 5月, 2016 4 次提交
    • E
      tcp: refresh skb timestamp at retransmit time · 10a81980
      Eric Dumazet 提交于
      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: NEric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Acked-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10a81980
    • D
      Merge branch 'nps_enet-fixes' · 3b0d190a
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      3b0d190a
    • E
      net: nps_enet: bug fix - handle lost tx interrupts · 05c00d82
      Elad Kanfi 提交于
      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: NElad Kanfi <eladkan@mellanox.com>
      Acked-by: NNoam Camus <noamca@mellanox.com>
      Acked-by: NGilad Ben-Yossef <giladby@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05c00d82
    • E
      net: nps_enet: Tx handler synchronization · e5df49d5
      Elad Kanfi 提交于
      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: NElad Kanfi <eladkan@mellanox.com>
      Acked-by: NNoam Camus <noamca@mellanox.com>
      Acked-by: NGilad Ben-Yossef <giladby@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5df49d5
  2. 10 5月, 2016 10 次提交
    • J
      export tc ife uapi header · d99079e2
      Jamal Hadi Salim 提交于
      Signed-off-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d99079e2
    • D
      Merge tag 'wireless-drivers-for-davem-2016-05-09' of... · 5e769ada
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      5e769ada
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · adc0a8bf
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      adc0a8bf
    • X
      net: thunderx: avoid exposing kernel stack · 161de2ca
      xypron.glpk@gmx.de 提交于
      Reserved fields should be set to zero to avoid exposing
      bits from the kernel stack.
      Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      161de2ca
    • K
      net: fix a kernel infoleak in x25 module · 79e48650
      Kangjie Lu 提交于
      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: NKangjie Lu <kjlu@gatech.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79e48650
    • G
      ravb: Add missing free_irq() call to ravb_close() · 7fa816b9
      Geert Uytterhoeven 提交于
      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: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7fa816b9
    • M
      uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h · 4a91cb61
      Mikko Rapeli 提交于
      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: NJan Engelhardt <jengelh@inai.de>
      Reported-by: NJosh Boyer <jwboyer@fedoraproject.org>
      Reported-by: NStephen Hemminger <shemming@brocade.com>
      Reported-by: NWaldemar Brodkorb <mail@waldemar-brodkorb.de>
      Cc: Gabriel Laskar <gabriel@lse.epita.fr>
      Signed-off-by: NMikko Rapeli <mikko.rapeli@iki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a91cb61
    • L
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · b507146b
      Linus Torvalds 提交于
      Pull crypto fixes from Herbert Xu:
       "This fixes the following issues:
      
         - bug in ahash SG list walking that may lead to crashes
      
         - resource leak in qat
      
         - missing RSA dependency that causes it to fail"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: rsa - select crypto mgr dependency
        crypto: hash - Fix page length clamping in hash walk
        crypto: qat - fix adf_ctl_drv.c:undefined reference to adf_init_pf_wq
        crypto: qat - fix invalid pf2vf_resp_wq logic
      b507146b
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 26acc792
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Check klogctl failure correctly, from Colin Ian King.
      
       2) Prevent OOM when under memory pressure in flowcache, from Steffen
          Klassert.
      
       3) Fix info leak in llc and rtnetlink ifmap code, from Kangjie Lu.
      
       4) Memory barrier and multicast handling fixes in bnxt_en, from Michael
          Chan.
      
       5) Endianness bug in mlx5, from Daniel Jurgens.
      
       6) Fix disconnect handling in VSOCK, from Ian Campbell.
      
       7) Fix locking of netdev list walking in get_bridge_ifindices(), from
          Nikolay Aleksandrov.
      
       8) Bridge multicast MLD parser can look at wrong packet offsets, fix
          from Linus Lüssing.
      
       9) Fix chip hang in qede driver, from Sudarsana Reddy Kalluru.
      
      10) Fix missing setting of encapsulation before inner handling completes
          in udp_offload code, from Jarno Rajahalme.
      
      11) Missing rollbacks during LAG join and flood configuration failures
          in mlxsw driver, from Ido Schimmel.
      
      12) Fix error code checks in netxen driver, from Dan Carpenter.
      
      13) Fix key size in new macsec driver, from Sabrina Dubroca.
      
      14) Fix mlx5/VXLAN dependencies, from Arnd Bergmann.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (29 commits)
        net/mlx5e: make VXLAN support conditional
        Revert "net/mlx5: Kconfig: Fix MLX5_EN/VXLAN build issue"
        macsec: key identifier is 128 bits, not 64
        Documentation/networking: more accurate LCO explanation
        macvtap: segmented packet is consumed
        tools: bpf_jit_disasm: check for klogctl failure
        qede: uninitialized variable in qede_start_xmit()
        netxen: netxen_rom_fast_read() doesn't return -1
        netxen: reversed condition in netxen_nic_set_link_parameters()
        netxen: fix error handling in netxen_get_flash_block()
        mlxsw: spectrum: Add missing rollback in flood configuration
        mlxsw: spectrum: Fix rollback order in LAG join failure
        udp_offload: Set encapsulation before inner completes.
        udp_tunnel: Remove redundant udp_tunnel_gro_complete().
        qede: prevent chip hang when increasing channels
        net: ipv6: tcp reset, icmp need to consider L3 domain
        bridge: fix igmp / mld query parsing
        net: bridge: fix old ioctl unlocked net device walk
        VSOCK: do not disconnect socket when peer has shutdown SEND only
        net/mlx4_en: Fix endianness bug in IPV6 csum calculation
        ...
      26acc792
    • J
      compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() · 8634de6d
      Josh Poimboeuf 提交于
      gcc support for __builtin_bswap16() was supposedly added for powerpc in
      gcc 4.6, and was then later added for other architectures in gcc 4.8.
      
      However, Stephen Rothwell reported that attempting to use it on powerpc
      in gcc 4.6 fails with:
      
        lib/vsprintf.c:160:2: error: initializer element is not constant
        lib/vsprintf.c:160:2: error: (near initialization for 'decpair[0]')
        lib/vsprintf.c:160:2: error: initializer element is not constant
        lib/vsprintf.c:160:2: error: (near initialization for 'decpair[1]')
        ...
      
      I'm not entirely sure what those errors mean, but I don't see them on
      gcc 4.8.  So let's consider gcc 4.8 to be the official starting point
      for __builtin_bswap16().
      
      Arnd Bergmann adds:
       "I found the commit in gcc-4.8 that replaced the powerpc-specific
        implementation of __builtin_bswap16 with an architecture-independent
        one.  Apparently the powerpc version (gcc-4.6 and 4.7) just mapped to
        the lhbrx/sthbrx instructions, so it ended up not being a constant,
        though the intent of the patch was mainly to add support for the
        builtin to x86:
      
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624
      
        has the patch that went into gcc-4.8 and more information."
      
      Fixes: 7322dd75 ("byteswap: try to avoid __builtin_constant_p gcc bug")
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Tested-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8634de6d
  3. 09 5月, 2016 9 次提交
  4. 08 5月, 2016 6 次提交
  5. 07 5月, 2016 11 次提交