1. 21 May, 2016 9 commits
    • Linus Torvalds's avatar
      Merge tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 2f37dd13
      Linus Torvalds authored
      Pull staging and IIO driver updates from Greg KH:
       "Here's the big staging and iio driver update for 4.7-rc1.
      
        I think we almost broke even with this release, only adding a few more
        lines than we removed, which isn't bad overall given that there's a
        bunch of new iio drivers added.
      
        The Lustre developers seem to have woken up from their sleep and have
        been doing a great job in cleaning up the code and pruning unused or
        old cruft, the filesystem is almost readable :)
      
        Other than that, just a lot of basic coding style cleanups in the
        churn.  All have been in linux-next for a while with no reported
        issues"
      
      * tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits)
        Staging: emxx_udc: emxx_udc: fixed coding style issue
        staging/gdm724x: fix "alignment should match open parenthesis" issues
        staging/gdm724x: Fix avoid CamelCase
        staging: unisys: rename misleading var ii with frag
        staging: unisys: visorhba: switch success handling to error handling
        staging: unisys: visorhba: main path needs to flow down the left margin
        staging: unisys: visorinput: handle_locking_key() simplifications
        staging: unisys: visorhba: fail gracefully for thread creation failures
        staging: unisys: visornic: comment restructuring and removing bad diction
        staging: unisys: fix format string %Lx to %llx for u64
        staging: unisys: remove unused struct members
        staging: unisys: visorchannel: correct variable misspelling
        staging: unisys: visorhba: replace functionlike macro with function
        staging: dgnc: Need to check for NULL of ch
        staging: dgnc: remove redundant condition check
        staging: dgnc: fix 'line over 80 characters'
        staging: dgnc: clean up the dgnc_get_modem_info()
        staging: lustre: lnet: enable configuration per NI interface
        staging: lustre: o2iblnd: properly set ibr_why
        staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
        ...
      2f37dd13
    • Linus Torvalds's avatar
      Merge tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 3aa2fc16
      Linus Torvalds authored
      Pull driver core updates from Greg KH:
       "Here's the "big" driver core update for 4.7-rc1.
      
        Mostly just debugfs changes, the long-known and messy races with
        removing debugfs files should be fixed thanks to the great work of
        Nicolai Stange.  We also have some isa updates in here (the x86
        maintainers told me to take it through this tree), a new warning when
        we run out of dynamic char major numbers, and a few other assorted
        changes, details in the shortlog.
      
        All have been in linux-next for some time with no reported issues"
      
      * tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
        Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
        gpio: ws16c48: Utilize the ISA bus driver
        gpio: 104-idio-16: Utilize the ISA bus driver
        gpio: 104-idi-48: Utilize the ISA bus driver
        gpio: 104-dio-48e: Utilize the ISA bus driver
        watchdog: ebc-c384_wdt: Utilize the ISA bus driver
        iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros
        iio: stx104: Add X86 dependency to STX104 Kconfig option
        Documentation: Add ISA bus driver documentation
        isa: Implement the max_num_isa_dev macro
        isa: Implement the module_isa_driver macro
        pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
        isa: Decouple X86_32 dependency from the ISA Kconfig option
        driver-core: use 'dev' argument in dev_dbg_ratelimited stub
        base: dd: don't remove driver_data in -EPROBE_DEFER case
        kernfs: Move faulting copy_user operations outside of the mutex
        devcoredump: add scatterlist support
        debugfs: unproxify files created through debugfs_create_u32_array()
        debugfs: unproxify files created through debugfs_create_blob()
        debugfs: unproxify files created through debugfs_create_bool()
        ...
      3aa2fc16
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 5af23440
      Linus Torvalds authored
      Pull char / misc driver updates from Greg KH:
       "Here's the big char and misc driver update for 4.7-rc1.
      
        Lots of different tiny driver subsystems have updates here with new
        drivers and functionality.  Details in the shortlog.
      
        All have been in linux-next with no reported issues for a while"
      
      * tag 'char-misc-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (125 commits)
        mcb: Delete num_cells variable which is not required
        mcb: Fixed bar number assignment for the gdd
        mcb: Replace ioremap and request_region with the devm version
        mcb: Implement bus->dev.release callback
        mcb: export bus information via sysfs
        mcb: Correctly initialize the bus's device
        mei: bus: call mei_cl_read_start under device lock
        coresight: etb10: adjust read pointer only when needed
        coresight: configuring ETF in FIFO mode when acting as link
        coresight: tmc: implementing TMC-ETF AUX space API
        coresight: moving struct cs_buffers to header file
        coresight: tmc: keep track of memory width
        coresight: tmc: make sysFS and Perf mode mutually exclusive
        coresight: tmc: dump system memory content only when needed
        coresight: tmc: adding mode of operation for link/sinks
        coresight: tmc: getting rid of multiple read access
        coresight: tmc: allocating memory when needed
        coresight: tmc: making prepare/unprepare functions generic
        coresight: tmc: splitting driver in ETB/ETF and ETR components
        coresight: tmc: cleaning up header file
        ...
      5af23440
    • Linus Torvalds's avatar
      Merge tag 'usb-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 19e36ad2
      Linus Torvalds authored
      Pull USB updates from Greg KH:
       "Here's the big pull request for USB and PHY drivers for 4.7-rc1
      
        Full details in the shortlog, but it's the normal major gadget driver
        updates, phy updates, new usbip code, as well as a bit of lots of
        other stuff.
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (164 commits)
        USB: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support
        USB: serial: fix minor-number allocation
        USB: serial: quatech2: fix use-after-free in probe error path
        USB: serial: mxuport: fix use-after-free in probe error path
        USB: serial: keyspan: fix debug and error messages
        USB: serial: keyspan: fix URB unlink
        USB: serial: keyspan: fix use-after-free in probe error path
        USB: serial: io_edgeport: fix memory leaks in probe error path
        USB: serial: io_edgeport: fix memory leaks in attach error path
        usb: Remove unnecessary space before operator ','.
        usb: Remove unnecessary space before open square bracket.
        USB: FHCI: avoid redundant condition
        usb: host: xhci-rcar: Avoid long wait in xhci_reset()
        usb/host/fotg210: remove dead code in create_sysfs_files
        usb: wusbcore: Do not initialise statics to 0.
        usb: wusbcore: Remove space before ',' and '(' .
        USB: serial: cp210x: clean up CRTSCTS flag code
        USB: serial: cp210x: get rid of magic numbers in CRTSCTS flag code
        USB: serial: cp210x: fix hardware flow-control disable
        USB: serial: option: add even more ZTE device ids
        ...
      19e36ad2
    • Linus Torvalds's avatar
      Merge tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · e10abc62
      Linus Torvalds authored
      Pull tty and serial driver updates from Greg KH:
       "Here's the large TTY and Serial driver update for 4.7-rc1.
      
        A few new serial drivers are added here, and Peter has fixed a bunch
        of long-standing bugs in the tty layer and serial drivers as normal.
        Full details in the shortlog.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits)
        MAINTAINERS: 8250: remove website reference
        serial: core: Fix port mutex assert if lockdep disabled
        serial: 8250_dw: fix wrong logic in dw8250_check_lcr()
        tty: vt, finish looping on duplicate
        tty: vt, return error when con_startup fails
        QE-UART: add "fsl,t1040-ucc-uart" to of_device_id
        serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios
        serial: 8250dw: Add device HID for future AMD UART controller
        Fix OpenSSH pty regression on close
        serial: mctrl_gpio: add IRQ locking
        serial: 8250: Integrate Fintek into 8250_base
        serial: mps2-uart: add support for early console
        serial: mps2-uart: add MPS2 UART driver
        dt-bindings: document the MPS2 UART bindings
        serial: sirf: Use generic uart-has-rtscts DT property
        serial: sirf: Introduce helper variable struct device_node *np
        serial: mxs-auart: Use generic uart-has-rtscts DT property
        serial: imx: Use generic uart-has-rtscts DT property
        doc: DT: Add Generic Serial Device Tree Bindings
        serial: 8250: of: Make tegra_serial_handle_break() static
        ...
      e10abc62
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 0eff4589
      Linus Torvalds authored
      Pull clk updates from Stephen Boyd:
       "It's the usual big pile of driver updates and additions, but we do
        have a couple core changes in here as well.
      
        Core:
      
         - CLK_IS_CRITICAL support has been added.  This should allow drivers
           to properly express that a certain clk should stay on even if their
           prepare/enable count drops to 0 (and in turn the parents of these
           clks should stay enabled).
      
         - A clk registration API has been added, clk_hw_register(), and an OF
           clk provider API has been added, of_clk_add_hw_provider().  These
           APIs have been put in place to further split clk providers from clk
           consumers, with the goal being to have clk providers never deal
           with struct clk pointers at all.  Conversion of provider drivers is
           on going.  clkdev has also gained support for registering clk_hw
           pointers directly so we can convert drivers that don't use
           devicetree.
      
        New Drivers:
      
         - Marvell ap806 and cp110 system controllers (with clks inside!)
         - Hisilicon Hi3519 clock and reset controller
         - Axis ARTPEC-6 clock controllers
         - Oxford Semiconductor OXNAS clock controllers
         - AXS10X I2S PLL
         - Rockchip RK3399 clock and reset controller
      
        Updates:
      
         - MMC2 and UART2 clks on Samsung Exynos 3250, ACLK on Samsung Exynos
           542x SoCs, and some more clk ID exporting for bus frequency scaling
         - Proper BCM2835 PCM clk support and various other clks
         - i.MX clk updates for i.MX6SX, i.MX7, and VF610
         - Renesas updates for R-Car H3
         - Tegra210 got updates for DisplayPort and HDMI 2.0
         - Rockchip driver refactorings and fixes due to adding RK3399 support"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (139 commits)
        clk: fix critical clock locking
        clk: qcom: mmcc-8996: Remove clocks that should be controlled by RPM
        clk: ingenic: Allow divider value to be divided
        clk: sunxi: Add display and TCON0 clocks driver
        clk: rockchip: drop old_rate calculation on pll rate changes
        clk: rockchip: simplify GRF handling in pll clocks
        clk: rockchip: lookup General Register Files in rockchip_clk_init
        clk: rockchip: fix the rk3399 sdmmc sample / drv name
        clk: mvebu: new driver for Armada CP110 system controller
        dt-bindings: arm: add DT binding for Marvell CP110 system controller
        clk: mvebu: new driver for Armada AP806 system controller
        clk: hisilicon: add CRG driver for hi3519 soc
        clk: hisilicon: export some hisilicon APIs to modules
        reset: hisilicon: add reset controller driver for hisilicon SOCs
        clk: bcm/kona: Do not use sizeof on pointer type
        clk: qcom: msm8916: Fix crypto clock flags
        clk: nxp: lpc18xx: Initialize clk_init_data::flags to 0
        clk/axs10x: Add I2S PLL clock driver
        clk: imx7d: fix ahb clock mux 1
        clk: fix comment of devm_clk_hw_register()
        ...
      0eff4589
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 087afe8a
      Linus Torvalds authored
      Pull networking fixes and more updates from David Miller:
      
       1) Tunneling fixes from Tom Herbert and Alexander Duyck.
      
       2) AF_UNIX updates some struct sock bit fields with the socket lock,
          whereas setsockopt() sets overlapping ones with locking.  Seperate
          out the synchronized vs.  the AF_UNIX unsynchronized ones to avoid
          corruption.  From Andrey Ryabinin.
      
       3) Mount BPF filesystem with mount_nodev rather than mount_ns, from
          Eric Biederman.
      
       4) A couple kmemdup conversions, from Muhammad Falak R Wani.
      
       5) BPF verifier fixes from Alexei Starovoitov.
      
       6) Don't let tunneled UDP packets get stuck in socket queues, if
          something goes wrong during the encapsulation just drop the packet
          rather than signalling an error up the call stack.  From Hannes
          Frederic Sowa.
      
       7) SKB ref after free in batman-adv, from Florian Westphal.
      
       8) TCP iSCSI, ocfs2, rds, and tipc have to disable BH in it's TCP
          callbacks since the TCP stack runs pre-emptibly now.  From Eric
          Dumazet.
      
       9) Fix crash in fixed_phy_add, from Rabin Vincent.
      
      10) Fix length checks in xen-netback, from Paul Durrant.
      
      11) Fix mixup in KEY vs KEYID macsec attributes, from Sabrina Dubroca.
      
      12) RDS connection spamming bug fixes from Sowmini Varadhan
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (152 commits)
        net: suppress warnings on dev_alloc_skb
        uapi glibc compat: fix compilation when !__USE_MISC in glibc
        udp: prevent skbs lingering in tunnel socket queues
        bpf: teach verifier to recognize imm += ptr pattern
        bpf: support decreasing order in direct packet access
        net: usb: ch9200: use kmemdup
        ps3_gelic: use kmemdup
        net:liquidio: use kmemdup
        bpf: Use mount_nodev not mount_ns to mount the bpf filesystem
        net: cdc_ncm: update datagram size after changing mtu
        tuntap: correctly wake up process during uninit
        intel: Add support for IPv6 IP-in-IP offload
        ip6_gre: Do not allow segmentation offloads GRE_CSUM is enabled with FOU/GUE
        RDS: TCP: Avoid rds connection churn from rogue SYNs
        RDS: TCP: rds_tcp_accept_worker() must exit gracefully when terminating rds-tcp
        net: sock: move ->sk_shutdown out of bitfields.
        ipv6: Don't reset inner headers in ip6_tnl_xmit
        ip4ip6: Support for GSO/GRO
        ip6ip6: Support for GSO/GRO
        ipv6: Set features for IPv6 tunnels
        ...
      087afe8a
    • Peter Zijlstra's avatar
      locking,qspinlock: Fix spin_is_locked() and spin_unlock_wait() · 54cf809b
      Peter Zijlstra authored
      Similar to commits:
      
        51d7d520 ("powerpc: Add smp_mb() to arch_spin_is_locked()")
        d86b8da0 ("arm64: spinlock: serialise spin_unlock_wait against concurrent lockers")
      
      qspinlock suffers from the fact that the _Q_LOCKED_VAL store is
      unordered inside the ACQUIRE of the lock.
      
      And while this is not a problem for the regular mutual exclusive
      critical section usage of spinlocks, it breaks creative locking like:
      
      	spin_lock(A)			spin_lock(B)
      	spin_unlock_wait(B)		if (!spin_is_locked(A))
      	do_something()			  do_something()
      
      In that both CPUs can end up running do_something at the same time,
      because our _Q_LOCKED_VAL store can drop past the spin_unlock_wait()
      spin_is_locked() loads (even on x86!!).
      
      To avoid making the normal case slower, add smp_mb()s to the less used
      spin_unlock_wait() / spin_is_locked() side of things to avoid this
      problem.
      Reported-and-tested-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
      Reported-by: default avatarGiovanni Gherdovich <ggherdovich@suse.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: stable@vger.kernel.org   # v4.2 and later
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      54cf809b
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · b99a9e87
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Two small cifs fixes, including one spnego upcall cifs security fix
        for stable"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        CIFS: Remove some obsolete comments
        cifs: Create dedicated keyring for spnego operations
      b99a9e87
  2. 20 May, 2016 31 commits
    • Neil Horman's avatar
      net: suppress warnings on dev_alloc_skb · 95829b3a
      Neil Horman authored
      Noticed an allocation failure in a network driver the other day on a 32 bit
      system:
      
      DMA-API: debugging out of memory - disabling
      bnx2fc: adapter_lookup: hba NULL
      lldpad: page allocation failure. order:0, mode:0x4120
      Pid: 4556, comm: lldpad Not tainted 2.6.32-639.el6.i686.debug #1
      Call Trace:
       [<c08a4086>] ? printk+0x19/0x23
       [<c05166a4>] ? __alloc_pages_nodemask+0x664/0x830
       [<c0649d02>] ? free_object+0x82/0xa0
       [<fb4e2c9b>] ? ixgbe_alloc_rx_buffers+0x10b/0x1d0 [ixgbe]
       [<fb4e2fff>] ? ixgbe_configure_rx_ring+0x29f/0x420 [ixgbe]
       [<fb4e228c>] ? ixgbe_configure_tx_ring+0x15c/0x220 [ixgbe]
       [<fb4e3709>] ? ixgbe_configure+0x589/0xc00 [ixgbe]
       [<fb4e7be7>] ? ixgbe_open+0xa7/0x5c0 [ixgbe]
       [<fb503ce6>] ? ixgbe_init_interrupt_scheme+0x5b6/0x970 [ixgbe]
       [<fb4e8e54>] ? ixgbe_setup_tc+0x1a4/0x260 [ixgbe]
       [<fb505a9f>] ? ixgbe_dcbnl_set_state+0x7f/0x90 [ixgbe]
       [<c088d80d>] ? dcb_doit+0x10ed/0x16d0
      ...
      
      Thought that perhaps the big splat in the logs wasn't really necessecary, as
      all call sites for dev_alloc_skb:
      
      a) check the return code for the function
      
      and
      
      b) either print their own error message or have a recovery path that makes the
      warning moot.
      
      Fix it by modifying dev_alloc_pages to pass __GFP_NOWARN as a gfp flag to
      suppress the warning
      
      applies to the net tree
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Alexander Duyck <alexander.duyck@gmail.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95829b3a
    • Nicolas Dichtel's avatar
      uapi glibc compat: fix compilation when !__USE_MISC in glibc · f0a3fdca
      Nicolas Dichtel authored
      These structures are defined only if __USE_MISC is set in glibc net/if.h
      headers, ie when _BSD_SOURCE or _SVID_SOURCE are defined.
      
      CC: Jan Engelhardt <jengelh@inai.de>
      CC: Josh Boyer <jwboyer@fedoraproject.org>
      CC: Stephen Hemminger <shemming@brocade.com>
      CC: Waldemar Brodkorb <mail@waldemar-brodkorb.de>
      CC: Gabriel Laskar <gabriel@lse.epita.fr>
      CC: Mikko Rapeli <mikko.rapeli@iki.fi>
      Fixes: 4a91cb61 ("uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h")
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0a3fdca
    • Hannes Frederic Sowa's avatar
      udp: prevent skbs lingering in tunnel socket queues · e5aed006
      Hannes Frederic Sowa authored
      In case we find a socket with encapsulation enabled we should call
      the encap_recv function even if just a udp header without payload is
      available. The callbacks are responsible for correctly verifying and
      dropping the packets.
      
      Also, in case the header validation fails for geneve and vxlan we
      shouldn't put the skb back into the socket queue, no one will pick
      them up there.  Instead we can simply discard them in the respective
      encap_recv functions.
      Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5aed006
    • David S. Miller's avatar
      Merge branch 'bpf-verifier-fixes' · cb543e80
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      bpf: verifier fixes
      
      Further testing of 'direct packet access' uncovered
      several usability issues. Fix them.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb543e80
    • Alexei Starovoitov's avatar
      bpf: teach verifier to recognize imm += ptr pattern · 1b9b69ec
      Alexei Starovoitov authored
      Humans don't write C code like:
        u8 *ptr = skb->data;
        int imm = 4;
        imm += ptr;
      but from llvm backend point of view 'imm' and 'ptr' are registers and
      imm += ptr may be preferred vs ptr += imm depending which register value
      will be used further in the code, while verifier can only recognize ptr += imm.
      That caused small unrelated changes in the C code of the bpf program to
      trigger rejection by the verifier. Therefore teach the verifier to recognize
      both ptr += imm and imm += ptr.
      For example:
      when R6=pkt(id=0,off=0,r=62) R7=imm22
      after r7 += r6 instruction
      will be R6=pkt(id=0,off=0,r=62) R7=pkt(id=0,off=22,r=62)
      
      Fixes: 969bf05e ("bpf: direct packet access")
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1b9b69ec
    • Alexei Starovoitov's avatar
      bpf: support decreasing order in direct packet access · d91b28ed
      Alexei Starovoitov authored
      when packet headers are accessed in 'decreasing' order (like TCP port
      may be fetched before the program reads IP src) the llvm may generate
      the following code:
      [...]                // R7=pkt(id=0,off=22,r=70)
      r2 = *(u32 *)(r7 +0) // good access
      [...]
      r7 += 40             // R7=pkt(id=0,off=62,r=70)
      r8 = *(u32 *)(r7 +0) // good access
      [...]
      r1 = *(u32 *)(r7 -20) // this one will fail though it's within a safe range
                            // it's doing *(u32*)(skb->data + 42)
      Fix verifier to recognize such code pattern
      
      Alos turned out that 'off > range' condition is not a verifier bug.
      It's a buggy program that may do something like:
      if (ptr + 50 > data_end)
        return 0;
      ptr += 60;
      *(u32*)ptr;
      in such case emit
      "invalid access to packet, off=0 size=4, R1(id=0,off=60,r=50)" error message,
      so all information is available for the program author to fix the program.
      
      Fixes: 969bf05e ("bpf: direct packet access")
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d91b28ed
    • Muhammad Falak R Wani's avatar
      net: usb: ch9200: use kmemdup · 238a9584
      Muhammad Falak R Wani authored
      Use kmemdup when some other buffer is immediately copied into allocated
      region. It replaces call to allocation followed by memcpy, by a single
      call to kmemdup.
      Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      238a9584
    • Muhammad Falak R Wani's avatar
      ps3_gelic: use kmemdup · 5877debe
      Muhammad Falak R Wani authored
      Use kmemdup when some other buffer is immediately copied into allocated
      region. It replaces call to allocation followed by memcpy, by a single
      call to kmemdup.
      Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5877debe
    • Muhammad Falak R Wani's avatar
      net:liquidio: use kmemdup · 7c542772
      Muhammad Falak R Wani authored
      Use kmemdup when some other buffer is immediately copied into allocated
      region. It replaces call to allocation followed by memcpy, by a single
      call to kmemdup.
      Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c542772
    • Eric W. Biederman's avatar
      bpf: Use mount_nodev not mount_ns to mount the bpf filesystem · e27f4a94
      Eric W. Biederman authored
      While reviewing the filesystems that set FS_USERNS_MOUNT I spotted the
      bpf filesystem.  Looking at the code I saw a broken usage of mount_ns
      with current->nsproxy->mnt_ns. As the code does not acquire a
      reference to the mount namespace it can not possibly be correct to
      store the mount namespace on the superblock as it does.
      
      Replace mount_ns with mount_nodev so that each mount of the bpf
      filesystem returns a distinct instance, and the code is not buggy.
      
      In discussion with Hannes Frederic Sowa it was reported that the use
      of mount_ns was an attempt to have one bpf instance per mount
      namespace, in an attempt to keep resources that pin resources from
      hiding.  That intent simply does not work, the vfs is not built to
      allow that kind of behavior.  Which means that the bpf filesystem
      really is buggy both semantically and in it's implemenation as it does
      not nor can it implement the original intent.
      
      This change is userspace visible, but my experience with similar
      filesystems leads me to believe nothing will break with a model of each
      mount of the bpf filesystem is distinct from all others.
      
      Fixes: b2197755 ("bpf: add support for persistent maps/progs")
      Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e27f4a94
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-for-davem-2016-05-13' of... · 56025caa
      David S. Miller authored
      Merge tag 'wireless-drivers-next-for-davem-2016-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers patches for 4.7
      
      Major changes:
      
      iwlwifi
      
      * remove IWLWIFI_DEBUG_EXPERIMENTAL_UCODE kconfig option
      * work for RX multiqueue continues
      * dynamic queue allocation work continues
      * add Luca as maintainer
      * a bunch of fixes and improvements all over
      
      brcmfmac
      
      * add 4356 sdio support
      
      ath6kl
      
      * add ability to set debug uart baud rate with a module parameter
      
      wil6210
      
      * add debugfs file to configure firmware led functionality
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56025caa
    • Rafal Redzimski's avatar
      net: cdc_ncm: update datagram size after changing mtu · 05a56487
      Rafal Redzimski authored
      Current implementation updates the mtu size and notify cdc_ncm
      device using USB_CDC_SET_MAX_DATAGRAM_SIZE request about datagram
      size change instead of changing rx_urb_size.
      
      Whenever mtu is being changed, datagram size should also be
      updated. Also updating maxmtu formula so it takes max_datagram_size with
      use of cdc_ncm_max_dgram_size() and not ctx.
      Signed-off-by: default avatarRobert Dobrowolski <robert.dobrowolski@linux.intel.com>
      Signed-off-by: default avatarRafal Redzimski <rafal.f.redzimski@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05a56487
    • Jason Wang's avatar
      tuntap: correctly wake up process during uninit · addf8fc4
      Jason Wang authored
      We used to check dev->reg_state against NETREG_REGISTERED after each
      time we are woke up. But after commit 9e641bdc ("net-tun:
      restructure tun_do_read for better sleep/wakeup efficiency"), it uses
      skb_recv_datagram() which does not check dev->reg_state. This will
      result if we delete a tun/tap device after a process is blocked in the
      reading. The device will wait for the reference count which was held
      by that process for ever.
      
      Fixes this by using RCV_SHUTDOWN which will be checked during
      sk_recv_datagram() before trying to wake up the process during uninit.
      
      Fixes: 9e641bdc ("net-tun: restructure tun_do_read for better
      sleep/wakeup efficiency")
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Xi Wang <xii@google.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      addf8fc4
    • David S. Miller's avatar
      Merge branch 'GREoIPV6-followups' · 7fd3c56d
      David S. Miller authored
      Alexander Duyck says:
      
      ====================
      Follow-ups for GUEoIPv6 patches
      
      This patch series is meant to be applied after:
      [PATCH v7 net-next 00/16] ipv6: Enable GUEoIPv6 and more fixes for v6 tunneling
      
      The first patch addresses an issue we already resolved in the GREv4 and is
      now present in GREv6 with the introduction of FOU/GUE for IPv6 based GRE
      tunnels.
      
      The second patch goes through and enables IPv6 tunnel offloads for the Intel
      NICs that already support the IPv4 based IP-in-IP tunnel offloads.  I have
      only done a bit of touch testing but have seen ~20 Gb/s over an i40e
      interface using a v4-in-v6 tunnel, and I have verified IPv6 GRE is still
      passing traffic at around the same rate.  I plan to do further testing but
      with these patches present it should enable a wider audience to be able to
      test the new features introduced in Tom's patchset with hardware offloads.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7fd3c56d
    • Alexander Duyck's avatar
      intel: Add support for IPv6 IP-in-IP offload · bf2d1df3
      Alexander Duyck authored
      This patch adds support for offloading IPXIP6 type packets that represent
      either IPv4 or IPv6 encapsulated inside of an IPv6 outer IP header.  In
      addition with this change we should also be able to support FOU
      encapsulated traffic with outer IPv6 headers.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf2d1df3
    • Alexander Duyck's avatar
      ip6_gre: Do not allow segmentation offloads GRE_CSUM is enabled with FOU/GUE · 6a553681
      Alexander Duyck authored
      This patch addresses the same issue we had for IPv4 where enabling GRE with
      an inner checksum cannot be supported with FOU/GUE due to the fact that
      they will jump past the GRE header at it is treated like a tunnel header.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a553681
    • David S. Miller's avatar
      Merge branch 'rds-conn-spamming' · 9a0351df
      David S. Miller authored
      Sowmini Varadhan says:
      
      ====================
      RDS: TCP: connection spamming fixes
      
      We have been testing the RDS-TCP code with a connection spammer
      that sends incoming SYNs to the RDS listen port well after
      an rds-tcp connection has been established, and found a few
      race-windows that are fixed by this patch series.
      
      Patch 1 avoids a null pointer deref when an incoming SYN
      shows up when a netns is being dismantled, or when the
      rds-tcp module is being unloaded.
      
      Patch 2 addresses the case when a SYN is received after the
      connection arbitration algorithm has converged: the incoming
      SYN should not needlessly quiesce the transmit path, and it
      should not result in needless TCP connection resets due to
      re-execution of the connection arbitration logic.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a0351df
    • Sowmini Varadhan's avatar
      RDS: TCP: Avoid rds connection churn from rogue SYNs · c948bb5c
      Sowmini Varadhan authored
      When a rogue SYN is received after the connection arbitration
      algorithm has converged, the incoming SYN should not needlessly
      quiesce the transmit path, and it should not result in needless
      TCP connection resets due to re-execution of the connection
      arbitration logic.
      Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c948bb5c
    • Sowmini Varadhan's avatar
      RDS: TCP: rds_tcp_accept_worker() must exit gracefully when terminating rds-tcp · 37e14f4f
      Sowmini Varadhan authored
      There are two instances where we want to terminate RDS-TCP: when
      exiting the netns or during module unload. In either case, the
      termination sequence is to stop the listen socket, mark the
      rtn->rds_tcp_listen_sock as null, and flush any accept workqs.
      Thus any workqs that get flushed at this point will encounter a
      null rds_tcp_listen_sock, and must exit gracefully to allow
      the RDS-TCP termination to complete successfully.
      Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37e14f4f
    • Linus Torvalds's avatar
      Merge tag 'gfs2-4.7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · be1332c0
      Linus Torvalds authored
      Pull GFS2 updates from Bob Peterson:
       "We've got nine patches this time:
      
         - Abhi Das has two patches that fix a GFS2 splice issue (and an
           adjustment).
      
         - Ben Marzinski has a patch which allows the proper unmount of a GFS2
           file system after hitting a withdraw error.
      
         - I have a patch to fix a problem where GFS2 would dereference an
           error value, plus three cosmetic / refactoring patches.
      
         - Daniel DeFreez has a patch to fix two glock reference count
           problems, where GFS2 was not properly "uninitializing" its glock
           holder on error paths.
      
         - Denys Vlasenko has a patch to change a function to not be inlined,
           thus reducing the memory footprint of the GFS2 module"
      
      * tag 'gfs2-4.7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        GFS2: Refactor gfs2_remove_from_journal
        GFS2: Remove allocation parms from gfs2_rbm_find
        gfs2: use inode_lock/unlock instead of accessing i_mutex directly
        GFS2: Add calls to gfs2_holder_uninit in two error handlers
        GFS2: Don't dereference inode in gfs2_inode_lookup until it's valid
        GFS2: fs/gfs2/glock.c: Deinline do_error, save 1856 bytes
        gfs2: Use gfs2 wrapper to sync inode before calling generic_file_splice_read()
        GFS2: Get rid of dead code in inode_go_demote_ok
        GFS2: ignore unlock failures after withdraw
      be1332c0
    • Andrey Ryabinin's avatar
      net: sock: move ->sk_shutdown out of bitfields. · fc64869c
      Andrey Ryabinin authored
      ->sk_shutdown bits share one bitfield with some other bits in sock struct,
      such as ->sk_no_check_[r,t]x, ->sk_userlocks ...
      sock_setsockopt() may write to these bits, while holding the socket lock.
      
      In case of AF_UNIX sockets, we change ->sk_shutdown bits while holding only
      unix_state_lock(). So concurrent setsockopt() and shutdown() may lead
      to corrupting these bits.
      
      Fix this by moving ->sk_shutdown bits out of bitfield into a separate byte.
      This will not change the 'struct sock' size since ->sk_shutdown moved into
      previously unused 16-bit hole.
      Signed-off-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Suggested-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc64869c
    • David S. Miller's avatar
      Merge branch 'GREoIPV6' · 911f6b1f
      David S. Miller authored
      Tom Herbert says:
      
      ====================
      ipv6: Enable GUEoIPv6 and more fixes for v6 tunneling
      
      This patch set:
        - Fixes GRE6 to process translate flags correctly from configuration
        - Adds support for GSO and GRO for ip6ip6 and ip4ip6
        - Add support for FOU and GUE in IPv6
        - Support GRE, ip6ip6 and ip4ip6 over FOU/GUE
        - Fixes ip6_input to deal with UDP encapsulations
        - Some other minor fixes
      
      v2:
        - Removed a check of GSO types in MPLS
        - Define GSO type SKB_GSO_IPXIP6 and SKB_GSO_IPXIP4 (based on input
          from Alexander)
        - Don't define GSO types specifically for IP6IP6 and IP4IP6, above
          fix makes that unnecessary
        - Don't bother clearing encapsulation flag in UDP tunnel segment
          (another item suggested by Alexander).
      
      v3:
        - Address some minor comments from Alexander
      
      v4:
        - Rebase on changes to fix IP TX tunnels
        - Fix MTU issues in ip4ip6, ip6ip6
        - Add test data for above
      
      v5:
        - Address feedback from Shmulik Ladkani regarding extension header
          code that does not return next header but in instead relies
          on returning value via nhoff. Solution here is to fix EH
          processing to return nexthdr value.
        - Refactored IPv4 encaps so that we won't need to create
          a ip6_tunnel_core.c when adding encap support IPv6.
      
      v6:
        - Fix build issues with regard to new GSO constants
        - FIx MTU calculation issues ip6_tunnel.c pointed out byt ALex
        - Add encap_hlen into headroom for GREv6 to work with FOU/GUE
      
      v7:
        - Added skb_set_inner_ipproto to ip4ip6 and ip6ip6
        - Clarified max_headroom in ip6_tnl_xmit
        - Set features for IPv6 tunnels
        - Other cleanup suggested by Alexander
        - Above fixes throughput performance issues in ip4ip6 and ip6ip6,
          updated test results to reflect that
      
      Tested: Various cases of IP tunnels with netperf TCP_STREAM and TCP_RR.
      
          - IPv4/GRE/GUE/IPv6 with RCO
            1 TCP_STREAM
            	6616 Mbps
            200 TCP_RR
      	1244043 tps
              141/243/446 90/95/99% latencies
      	86.61% CPU utilization
      
          - IPv6/GRE/GUE/IPv6 with RCO
            1 TCP_STREAM
      	6940 Mbps
            200 TCP_RR
      	1270903 tps
      	138/236/440 90/95/99% latencies
      	87.51% CPU utilization
      
           - IP6IP6
            1 TCP_STREAM
      	5307 Mbps
            200 TCP_RR
      	498981 tps
      	388/498/631 90/95/99% latencies
      	19.75% CPU utilization (1 CPU saturated)
      
           - IP6IP6/GUE with RCO
            1 TCP_STREAM
      	5575 Mbps
            200 TCP_RR
      	1233818 tps
      	143/244/451 90/95/99% latencies
      	87.57 CPU utilization
      
           - IP4IP6
            1 TCP_STREAM
      	5235 Mbps
            200 TCP_RR
      	763774 tps
      	250/318/466 90/95/99% latencies
      	35.25% CPU utilization (1 CPU saturated)
      
           - IP4IP6/GUE with RCO
            1 TCP_STREAM
      	5337 Mbps
            200 TCP_RR
      	1196385 tps
      	148/251/460 90/95/99% latencies
      	87.56 CPU utilization
      
           - GRE with keyid
            200 TCP_RR
      	744173 tps
      	258/332/461 90/95/99% latencies
      	34.59% CPU utilization (1 CPU saturated)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      911f6b1f
    • Tom Herbert's avatar
      ipv6: Don't reset inner headers in ip6_tnl_xmit · 3ee93eaf
      Tom Herbert authored
      Since iptunnel_handle_offloads() is called in all paths we can
      probably drop the block in ip6_tnl_xmit that was checking for
      skb->encapsulation and resetting the inner headers.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ee93eaf
    • Tom Herbert's avatar
      ip4ip6: Support for GSO/GRO · b8921ca8
      Tom Herbert authored
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b8921ca8
    • Tom Herbert's avatar
      ip6ip6: Support for GSO/GRO · 815d22e5
      Tom Herbert authored
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      815d22e5
    • Tom Herbert's avatar
      ipv6: Set features for IPv6 tunnels · 51c052d4
      Tom Herbert authored
      Need to set dev features, use same values that are used in GREv6.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      51c052d4
    • Tom Herbert's avatar
      ip6_tunnel: Add support for fou/gue encapsulation · b3a27b51
      Tom Herbert authored
      Add netlink and setup for encapsulation
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3a27b51
    • Tom Herbert's avatar
      ip6_gre: Add support for fou/gue encapsulation · 1faf3d9f
      Tom Herbert authored
      Add netlink and setup for encapsulation
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1faf3d9f
    • Tom Herbert's avatar
      fou: Add encap ops for IPv6 tunnels · aa3463d6
      Tom Herbert authored
      This patch add a new fou6 module that provides encapsulation
      operations for IPv6.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa3463d6
    • Tom Herbert's avatar
      ip6_tun: Add infrastructure for doing encapsulation · 058214a4
      Tom Herbert authored
      Add encap_hlen and ip_tunnel_encap structure to ip6_tnl. Add functions
      for getting encap hlen, setting up encap on a tunnel, performing
      encapsulation operation.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      058214a4
    • Tom Herbert's avatar
      fou: Support IPv6 in fou · 5f914b68
      Tom Herbert authored
      This patch adds receive path support for IPv6 with fou.
      
      - Add address family to fou structure for open sockets. This supports
        AF_INET and AF_INET6. Lookups for fou ports are performed on both the
        port number and family.
      - In fou and gue receive adjust tot_len in IPv4 header or payload_len
        based on address family.
      - Allow AF_INET6 in FOU_ATTR_AF netlink attribute.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f914b68