1. 16 Feb, 2019 1 commit
    • Paul Burton's avatar
      MIPS: eBPF: Always return sign extended 32b values · 13443154
      Paul Burton authored
      The function prototype used to call JITed eBPF code (ie. the type of the
      struct bpf_prog bpf_func field) returns an unsigned int. The MIPS n64
      ABI that MIPS64 kernels target defines that 32 bit integers should
      always be sign extended when passed in registers as either arguments or
      return values.
      This means that when returning any value which may not already be sign
      extended (ie. of type REG_64BIT or REG_32BIT_ZERO_EX) we need to perform
      that sign extension in order to comply with the n64 ABI. Without this we
      see strange looking test failures from test_bpf.ko, such as:
        test_bpf: #65 ALU64_MOV_X:
          dst = 4294967295 jited:1 ret -1 != -1 FAIL (1 times)
      Although the return value printed matches the expected value, this is
      only because printf is only examining the least significant 32 bits of
      the 64 bit register value we returned. The register holding the expected
      value is sign extended whilst the v0 register was set to a zero extended
      value by our JITed code, so when compared by a conditional branch
      instruction the values are not equal.
      We already handle this when the return value register is of type
      REG_32BIT_ZERO_EX, so simply extend this to also cover REG_64BIT.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Fixes: b6bd53f9
       ("MIPS: Add missing file for eBPF JIT.")
      Cc: stable@vger.kernel.org # v4.13+
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
  2. 12 Feb, 2019 1 commit
  3. 11 Feb, 2019 4 commits
    • Davidlohr Bueso's avatar
      xsk: share the mmap_sem for page pinning · e451eb51
      Davidlohr Bueso authored
      Holding mmap_sem exclusively for a gup() is an overkill. Lets
      share the lock and replace the gup call for gup_longterm(), as
      it is better suited for the lifetime of the pinning.
      Fixes: c0c77d8f
       ("xsk: add user memory registration support sockopt")
      Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Bjorn Topel <bjorn.topel@intel.com>
      Cc: Magnus Karlsson <magnus.karlsson@intel.com>
      CC: netdev@vger.kernel.org
      Acked-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    • Alexei Starovoitov's avatar
      bpf: fix lockdep false positive in stackmap · 3defaf2f
      Alexei Starovoitov authored
      Lockdep warns about false positive:
      [   11.211460] ------------[ cut here ]------------
      [   11.211936] DEBUG_LOCKS_WARN_ON(depth <= 0)
      [   11.211985] WARNING: CPU: 0 PID: 141 at ../kernel/locking/lockdep.c:3592 lock_release+0x1ad/0x280
      [   11.213134] Modules linked in:
      [   11.214954] RIP: 0010:lock_release+0x1ad/0x280
      [   11.223508] Call Trace:
      [   11.223705]  <IRQ>
      [   11.223874]  ? __local_bh_enable+0x7a/0x80
      [   11.224199]  up_read+0x1c/0xa0
      [   11.224446]  do_up_read+0x12/0x20
      [   11.224713]  irq_work_run_list+0x43/0x70
      [   11.225030]  irq_work_run+0x26/0x50
      [   11.225310]  smp_irq_work_interrupt+0x57/0x1f0
      [   11.225662]  irq_work_interrupt+0xf/0x20
      since rw_semaphore is released in a different task vs task that locked the sema.
      It is expected behavior.
      Fix the warning with up_read_non_owner() and rwsem_release() annotation.
      Fixes: bae77c5e
       ("bpf: enable stackmap with build_id in nmi context")
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    • Magnus Karlsson's avatar
      xsk: add missing smp_rmb() in xsk_mmap · e6762c8b
      Magnus Karlsson authored
      All the setup code in AF_XDP is protected by a mutex with the
      exception of the mmap code that cannot use it. To make sure that a
      process banging on the mmap call at the same time as another process
      is setting up the socket, smp_wmb() calls were added in the umem
      registration code and the queue creation code, so that the published
      structures that xsk_mmap needs would be consistent. However, the
      corresponding smp_rmb() calls were not added to the xsk_mmap
      code. This patch adds these calls.
      Fixes: 37b07693 ("xsk: add missing write- and data-dependency barrier")
      Fixes: c0c77d8f
       ("xsk: add user memory registration support sockopt")
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    • Willem de Bruijn's avatar
      bpf: only adjust gso_size on bytestream protocols · b90efd22
      Willem de Bruijn authored
      bpf_skb_change_proto and bpf_skb_adjust_room change skb header length.
      For GSO packets they adjust gso_size to maintain the same MTU.
      The gso size can only be safely adjusted on bytestream protocols.
      Commit d02f51cb ("bpf: fix bpf_skb_adjust_net/bpf_skb_proto_xlat
      to deal with gso sctp skbs") excluded SKB_GSO_SCTP.
      Since then type SKB_GSO_UDP_L4 has been added, whose contents are one
      gso_size unit per datagram. Also exclude these.
      Move from a blacklist to a whitelist check to future proof against
      additional such new GSO types, e.g., for fraglist based GRO.
      Fixes: bec1f6f6
       ("udp: generate gso with UDP_SEGMENT")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
  4. 10 Feb, 2019 1 commit
    • Martin KaFai Lau's avatar
      bpf: Fix narrow load on a bpf_sock returned from sk_lookup() · d6238766
      Martin KaFai Lau authored
      By adding this test to test_verifier:
      	"reference tracking: access sk->src_ip4 (narrow load)",
      	.insns = {
      	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
      	BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
      	BPF_LDX_MEM(BPF_H, BPF_REG_2, BPF_REG_0, offsetof(struct bpf_sock, src_ip4) + 2),
      	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
      	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
      	.result = ACCEPT,
      The above test loads 2 bytes from sk->src_ip4 where
      sk is obtained by bpf_sk_lookup_tcp().
      It hits an internal verifier error from convert_ctx_accesses():
      [root@arch-fb-vm1 bpf]# ./test_verifier 665 665
      Failed to load prog 'Invalid argument'!
      0: (b7) r2 = 0
      1: (63) *(u32 *)(r10 -8) = r2
      2: (7b) *(u64 *)(r10 -16) = r2
      3: (7b) *(u64 *)(r10 -24) = r2
      4: (7b) *(u64 *)(r10 -32) = r2
      5: (7b) *(u64 *)(r10 -40) = r2
      6: (7b) *(u64 *)(r10 -48) = r2
      7: (bf) r2 = r10
      8: (07) r2 += -48
      9: (b7) r3 = 36
      10: (b7) r4 = 0
      11: (b7) r5 = 0
      12: (85) call bpf_sk_lookup_tcp#84
      13: (bf) r6 = r0
      14: (15) if r0 == 0x0 goto pc+3
       R0=sock(id=1,off=0,imm=0) R6=sock(id=1,off=0,imm=0) R10=fp0,call_-1 fp-8=????0000 fp-16=0000mmmm fp-24=mmmmmmmm fp-32=mmmmmmmm fp-40=mmmmmmmm fp-48=mmmmmmmm refs=1
      15: (69) r2 = *(u16 *)(r0 +26)
      16: (bf) r1 = r6
      17: (85) call bpf_sk_release#86
      18: (95) exit
      from 14 to 18: safe
      processed 20 insns (limit 131072), stack depth 48
      bpf verifier is misconfigured
      Summary: 0 PASSED, 0 SKIPPED, 1 FAILED
      The bpf_sock_is_valid_access() is expecting src_ip4 can be narrowly
      loaded (meaning load any 1 or 2 bytes of the src_ip4) by
      marking info->ctx_field_size.  However, this marked
      ctx_field_size is not used.  This patch fixes it.
      Due to the recent refactoring in test_verifier,
      this new test will be added to the bpf-next branch
      (together with the bpf_tcp_sock patchset)
      to avoid merge conflict.
      Fixes: c64b7983
       ("bpf: Add PTR_TO_SOCKET verifier type")
      Cc: Joe Stringer <joe@wand.net.nz>
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Acked-by: default avatarJoe Stringer <joe@wand.net.nz>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
  5. 09 Feb, 2019 3 commits
  6. 08 Feb, 2019 12 commits
    • Russell King's avatar
      net: sfp: do not probe SFP module before we're attached · b5bfc21a
      Russell King authored
      When we probe a SFP module, we expect to be able to call the upstream
      device's module_insert() function so that the upstream link can be
      configured.  However, when the upstream device is delayed, we currently
      may end up probing the module before the upstream device is available,
      and lose the module_insert() call.
      Avoid this by holding off probing the module until the SFP bus is
      properly connected to both the SFP socket driver and the upstream
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 27b4ad62
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "This pull request is dedicated to the upcoming snowpocalypse parts 2
        and 3 in the Pacific Northwest:
         1) Drop profiles are broken because some drivers use dev_kfree_skb*
            instead of dev_consume_skb*, from Yang Wei.
         2) Fix IWLWIFI kconfig deps, from Luca Coelho.
         3) Fix percpu maps updating in bpftool, from Paolo Abeni.
         4) Missing station release in batman-adv, from Felix Fietkau.
         5) Fix some networking compat ioctl bugs, from Johannes Berg.
         6) ucc_geth must reset the BQL queue state when stopping the device,
            from Mathias Thore.
         7) Several XDP bug fixes in virtio_net from Toshiaki Makita.
         8) TSO packets must be sent always on queue 0 in stmmac, from Jose
         9) Fix socket refcounting bug in RDS, from Eric Dumazet.
        10) Handle sparse cpu allocations in bpf selftests, from Martynas
        11) Make sure mgmt frames have enough tailroom in mac80211, from Felix
        12) Use safe list walking in sctp_sendmsg() asoc list traversal, from
            Greg Kroah-Hartman.
        13) Make DCCP's ccid_hc_[rt]x_parse_options always check for NULL
            ccid, from Eric Dumazet.
        14) Need to reload WoL password into bcmsysport device after deep
            sleeps, from Florian Fainelli.
        15) Remove filter from mask before freeing in cls_flower, from Petr
        16) Missing release and use after free in error paths of s390 qeth
            code, from Julian Wiedmann.
        17) Fix lockdep false positive in dsa code, from Marc Zyngier.
        18) Fix counting of ATU violations in mv88e6xxx, from Andrew Lunn.
        19) Fix EQ firmware assert in qed driver, from Manish Chopra.
        20) Don't default Caivum PTP to Y in kconfig, from Bjorn Helgaas"
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
        net: dsa: b53: Fix for failure when irq is not defined in dt
        sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()
        geneve: should not call rt6_lookup() when ipv6 was disabled
        net: Don't default Cavium PTP driver to 'y'
        net: broadcom: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: via-velocity: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: tehuti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: sun: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: fsl_ucc_hdlc: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: fec_mpc52xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: smsc: epic100: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: dscc4: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: tulip: de2104x: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: defxx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net/mlx5e: Don't overwrite pedit action when multiple pedit used
        net/mlx5e: Update hw flows when encap source mac changed
        qed*: Advance drivers version to
        qed: Change verbosity for coalescing message.
        qede: Fix system crash on configuring channels.
        qed: Consider TX tcs while deriving the max num_queues for PF.
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 68090543
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Here are some small char and misc driver fixes for 5.0-rc6.
        Nothing huge here, some more binderfs fixups found as people use it,
        and there is a "large" selftest added to validate the binderfs code,
        which makes up the majority of this pull request.
        There's also some small mei and mic fixes to resolve some reported
        All of these have been in linux-next for over a week with no reported
      * tag 'char-misc-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        mic: vop: Fix crash on remove
        mic: vop: Fix use-after-free on remove
        binderfs: remove separate device_initcall()
        fpga: stratix10-soc: fix wrong of_node_put() in init function
        mic: vop: Fix broken virtqueues
        mei: free read cb on ctrl_wr list flush
        samples: mei: use /dev/mei0 instead of /dev/mei
        mei: me: add ice lake point device id.
        binderfs: respect limit on binder control creation
        selftests: add binderfs selftests
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 8c8e62cc
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are some driver core fixes for 5.0-rc6.
        Well, not so much "driver core" as "debugfs". There's a lot of
        outstanding debugfs cleanup patches coming in through different
        subsystem trees, and in that process the debugfs core was found that
        it really should return errors when something bad happens, to prevent
        random files from showing up in the root of debugfs afterward. So
        debugfs was fixed up to handle this properly, and then two fixes for
        the relay and blk-mq code was needed as it was making invalid
        assumptions about debugfs return values.
        There's also a cacheinfo fix in here that resolves a tiny issue.
        All of these have been in linux-next for over a week with no reported
      * tag 'driver-core-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        blk-mq: protect debugfs_create_files() from failures
        relay: check return of create_buf_file() properly
        debugfs: debugfs_lookup() should return NULL if not found
        debugfs: return error values, not NULL
        debugfs: fix debugfs_rename parameter checking
        cacheinfo: Keep the old value if of_property_read_u32 fails
    • Linus Torvalds's avatar
      Merge tag 'staging-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · e464f50c
      Linus Torvalds authored
      Pull staging/IIO driver fixes from Greg KH:
       "Here are some small iio and staging driver fixes for 5.0-rc6.
        Nothing big, just resolve some reported IIO driver issues, and one
        staging driver bug. One staging driver patch was added and then
        reverted as well.
        All of these have been in linux-next for a while with no reported
      * tag 'staging-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        Revert "staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()"
        staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()
        staging: octeon: fix broken phylib usage
        iio: ti-ads8688: Update buffer allocation for timestamps
        tools: iio: iio_generic_buffer: make num_loops signed
        iio: adc: axp288: Fix TS-pin handling
        iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius
    • Linus Torvalds's avatar
      Merge tag 'tty-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · e22a15d1
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small tty and serial fixes for 5.0-rc6.
        Nothing huge, just a few small fixes for reported issues. The speakup
        fix is in here as it is a tty operation issue.
        All of these have been in linux-next for a while with no reported
      * tag 'tty-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: fix race between flush_to_ldisc and tty_open
        staging: speakup: fix tty-operation NULL derefs
        serial: sh-sci: Do not free irqs that have already been freed
        serial: 8250_pci: Make PCI class test non fatal
        tty: serial: 8250_mtk: Fix potential NULL pointer dereference
    • Linus Torvalds's avatar
      Merge tag 'usb-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 00a159a0
      Linus Torvalds authored
      Pull USB fixes from Grek KH:
       "Here are some small USB fixes for 5.0-rc6.
        Nothing huge, the normal amount of USB gadget fixes as well as some
        USB phy fixes. There's also a typec fix as well. Full details are in
        the shortlog.
        All of these have been in linux-next for a while with no reported
      * tag 'usb-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: tcpm: Correct the PPS out_volt calculation
        usb: gadget: musb: fix short isoc packets with inventra dma
        usb: phy: am335x: fix race condition in _probe
        usb: dwc3: exynos: Fix error handling of clk_prepare_enable
        usb: phy: fix link errors
        usb: gadget: udc: net2272: Fix bitwise and boolean operations
        usb: dwc3: gadget: Handle 0 xfer length for OUT EP
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.0-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · bd5ff862
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "Here are a handful of XFS fixes to fix a data corruption problem, a
        crasher bug, and a deadlock.
         - Fix cache coherency problem with writeback mappings
         - Fix buffer deadlock when shutting fs down
         - Fix a null pointer dereference when running online repair"
      * tag 'xfs-5.0-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: set buffer ops when repair probes for btree type
        xfs: end sync buffer I/O properly on shutdown error
        xfs: eof trim writeback mapping as soon as it is cached
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-02-08' of git://anongit.freedesktop.org/drm/drm · adcbc921
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Missed fixes last week as had nothing until amdgpu showed up on
        Saturday. Other stuff has since rolled in along with some more amdgpu
        fixes, so we have two weeks of those, and some i915, vmwgfx, sun4i,
        rockchip and omap fixes.
         - fix crash on passthrough for SI
         - fencing fix for shared buffers
         - APU hwmon fix
         - API powerplay fix
         - eDP freesync fix
         - PASID mgr locking fix
         - KFD warning fix
         - DC/powerplay fix
         - raven revision ids fix
         - vega20 doorbell fix
         - SNB display fix
         - SKL srckey mask fix
         - ICL DDI clock selection fix
         - DMA API fix
         - IOMMU detection fix
         - display fixes
         - tcon clock fix
         - SPDX identifier fix
         - DSI fixes"
      * tag 'drm-fixes-2019-02-08' of git://anongit.freedesktop.org/drm/drm: (28 commits)
        drm/omap: dsi: Hack-fix DSI bus flags
        drm/omap: dsi: Fix OF platform depopulate
        drm/omap: dsi: Fix crash in DSI debug dumps
        drm/i915: Try to sanitize bogus DPLL state left over by broken SNB BIOSen
        drm/amd/display: Attach VRR properties for eDP connectors
        drm/amdkfd: Fix if preprocessor statement above kfd_fill_iolink_info_for_cpu
        drm/amdgpu: use spin_lock_irqsave to protect vm_manager.pasid_idr
        drm/i915: always return something on DDI clock selection
        drm/i915: Fix skl srckey mask bits
        drm/vmwgfx: Improve on IOMMU detection
        drm/vmwgfx: Fix setting of dma masks
        drm/vmwgfx: Also check for crtc status while checking for DU active
        drm/vmwgfx: Fix an uninitialized fence handle value
        drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user
        drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init
        drm/amdgpu: fix the incorrect external id for raven series
        drm/amdgpu: Implement doorbell self-ring for NBIO 7.4
        drm/amd/display: Fix fclk idle state
        drm/amdgpu: Transfer fences to dmabuf importer
        drm/amd/powerplay: Fix missing break in switch
    • Arun Parameswaran's avatar
      net: dsa: b53: Fix for failure when irq is not defined in dt · 39841cc1
      Arun Parameswaran authored
      Fixes the issues with non BCM58XX chips in the b53 driver
      failing, when the irq is not specified in the device tree.
      Removed the check for BCM58XX in b53_srab_prepare_irq(),
      so the 'port->irq' will be set to '-EXIO' if the irq is not
      specified in the device tree.
      Fixes: 16994374 ("net: dsa: b53: Make SRAB driver manage port interrupts")
      Fixes: b2ddc48a
       ("net: dsa: b53: Do not fail when IRQ are not initialized")
      Signed-off-by: default avatarArun Parameswaran <arun.parameswaran@broadcom.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2019-02-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · dada163c
      Dave Airlie authored
      drm-misc-fixes for v5.0-rc6:
      - Fixes to omap/dsi encoder.
      - Clock fix for sun4i.
      - Licensing header fix for rockchip.
      - Fix division by zero in the mode when trying to set a mode on
        i915 with GVT-g enabled.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/84462cef-609f-e2af-084a-f9fe2b05c53e@linux.intel.com
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2019-02-07-1' of... · 151e3d6a
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2019-02-07-1' of git://anongit.freedesktop.org/drm/drm-intel
       into drm-fixes
      drm/i915 fixes for v5.0-rc6:
      - SNB DPLL sanitize
      - ICL DDI clock selection
      - SLK srckey mask
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/87lg2s6nur.fsf@intel.com
  7. 07 Feb, 2019 18 commits