1. 20 Jul, 2017 4 commits
  2. 18 Jul, 2017 19 commits
  3. 17 Jul, 2017 7 commits
    • Moni Shoua's avatar
      IB/core: Don't resolve IP address to the loopback device · cbd09aeb
      Moni Shoua authored
      When resolving an IP address that is on the host of the caller the
      result from querying the routing table is the loopback device. This is
      not a valid response, because it doesn't represent the RDMA device and
      the port.
      
      Therefore, callers need to check the resolved device and if it is a
      loopback device find an alternative way to resolve it. To avoid this we
      make sure that the response from rdma_resolve_ip() will not be the
      loopback device.
      
      While that, we fix an static checker warning about dereferencing an
      unintitialized pointer using the same solution as in commit abeffce9
      ("net/mlx5e: Fix a -Wmaybe-uninitialized warning") as a reference.
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      cbd09aeb
    • Moni Shoua's avatar
      IB/core: Namespace is mandatory input for address resolution · bebb2a47
      Moni Shoua authored
      In function addr_resolve() the namespace is a required input parameter
      and not an output. It is passed later for searching the routing table
      and device addresses. Also, it shouldn't be copied back to the caller.
      
      Fixes: 565edd1d ('IB/addr: Pass network namespace as a parameter')
      Cc: <stable@vger.kernel.org> # v4.3+
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      bebb2a47
    • Vladimir Neyelov's avatar
      IB/iser: Fix connection teardown race condition · c8c16d3b
      Vladimir Neyelov authored
      Under heavy iser target(scst) start/stop stress during login/logout
      on iser intitiator side happened trace call provided below.
      
      The function iscsi_iser_slave_alloc iser_conn pointer could be NULL,
      due to the fact that function iscsi_iser_conn_stop can be called before
      and free iser connection. Let's protect that flow by introducing global mutex.
      
      BUG: unable to handle kernel paging request at 0000000000001018
      IP: [<ffffffffc0426f7e>] iscsi_iser_slave_alloc+0x1e/0x50 [ib_iser]
      Call Trace:
      ? scsi_alloc_sdev+0x242/0x300
      scsi_probe_and_add_lun+0x9e1/0xea0
      ? kfree_const+0x21/0x30
      ? kobject_set_name_vargs+0x76/0x90
      ? __pm_runtime_resume+0x5b/0x70
      __scsi_scan_target+0xf6/0x250
      scsi_scan_target+0xea/0x100
      iscsi_user_scan_session.part.13+0x101/0x130 [scsi_transport_iscsi]
      ? iscsi_user_scan_session.part.13+0x130/0x130 [scsi_transport_iscsi]
      iscsi_user_scan_session+0x1e/0x30 [scsi_transport_iscsi]
      device_for_each_child+0x50/0x90
      iscsi_user_scan+0x44/0x60 [scsi_transport_iscsi]
      store_scan+0xa8/0x100
      ? common_file_perm+0x5d/0x1c0
      dev_attr_store+0x18/0x30
      sysfs_kf_write+0x37/0x40
      kernfs_fop_write+0x12c/0x1c0
      __vfs_write+0x18/0x40
      vfs_write+0xb5/0x1a0
      SyS_write+0x55/0xc0
      
      Fixes: 318d311e ("iser: Accept arbitrary sg lists mapping if the device supports it")
      Cc: <stable@vger.kernel.org> # v4.5+
      Signed-off-by: default avatarVladimir Neyelov <vladimirn@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimbeg.me>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      c8c16d3b
    • Gustavo A. R. Silva's avatar
      RDMA/core: Document confusing code · 28b5b3a2
      Gustavo A. R. Silva authored
      While looking into Coverity ID 1351047 I ran into the following
      piece of code at
      drivers/infiniband/core/verbs.c:496:
      
      ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid,
                                         ah_attr->dmac,
                                         wc->wc_flags & IB_WC_WITH_VLAN ?
                                         NULL : &vlan_id,
                                         &if_index, &hoplimit);
      
      The issue here is that the position of arguments in the call to
      rdma_addr_find_l2_eth_by_grh() function do not match the order of
      the parameters:
      
      &dgid is passed to sgid
      &sgid is passed to dgid
      
      This is the function prototype:
      
      int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
       				 const union ib_gid *dgid,
       				 u8 *dmac, u16 *vlan_id, int *if_index,
       				 int *hoplimit)
      
      My question here is if this is intentional?
      
      Answer:
      Yes. ib_init_ah_from_wc() creates ah from the incoming packet.
      Incoming packet has dgid of the receiver node on which this code is
      getting executed and sgid contains the GID of the sender.
      
      When resolving mac address of destination, you use arrived dgid as
      sgid and use sgid as dgid because sgid contains destinations GID whom to
      respond to.
      Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      28b5b3a2
    • Bart Van Assche's avatar
      mlx5: Avoid that mlx5_ib_sg_to_klms() overflows the klms[] array · 99975cd4
      Bart Van Assche authored
      ib_map_mr_sg() can pass an SG-list to .map_mr_sg() that is larger
      than what fits into a single MR. .map_mr_sg() must not attempt to
      map more SG-list elements than what fits into a single MR.
      Hence make sure that mlx5_ib_sg_to_klms() does not write outside
      the MR klms[] array.
      
      Fixes: b005d316 ("mlx5: Add arbitrary sg list support")
      Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Cc: Israel Rukshin <israelr@mellanox.com>
      Cc: <stable@vger.kernel.org>
      Acked-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      99975cd4
    • Dennis Dalessandro's avatar
      IB/hfi1: Ensure dd->gi_mask can not be overflowed · 91647f4c
      Dennis Dalessandro authored
      As the code stands today the array access in remap_intr() is OK. To
      future proof the code though we should explicitly check to ensure the
      index value is not outside of the valid range. This is not a straight
      forward calculation so err on the side of caution.
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      91647f4c
    • Doug Ledford's avatar
      Merge tag 'v4.13-rc1' into k.o/for-4.13-rc · 3d886aa3
      Doug Ledford authored
      Linux v4.13-rc1
      3d886aa3
  4. 15 Jul, 2017 10 commits
    • Linus Torvalds's avatar
      Linux v4.13-rc1 · 5771a8c0
      Linus Torvalds authored
      5771a8c0
    • Linus Torvalds's avatar
      Merge tag 'standardize-docs' of git://git.lwn.net/linux · 486088bc
      Linus Torvalds authored
      Pull documentation format standardization from Jonathan Corbet:
       "This series converts a number of top-level documents to the RST format
        without incorporating them into the Sphinx tree. The hope is to bring
        some uniformity to kernel documentation and, perhaps more importantly,
        have our existing docs serve as an example of the desired formatting
        for those that will be added later.
      
        Mauro has gone through and fixed up a lot of top-level documentation
        files to make them conform to the RST format, but without moving or
        renaming them in any way. This will help when we incorporate the ones
        we want to keep into the Sphinx doctree, but the real purpose is to
        bring a bit of uniformity to our documentation and let the top-level
        docs serve as examples for those writing new ones"
      
      * tag 'standardize-docs' of git://git.lwn.net/linux: (84 commits)
        docs: kprobes.txt: Fix whitespacing
        tee.txt: standardize document format
        cgroup-v2.txt: standardize document format
        dell_rbu.txt: standardize document format
        zorro.txt: standardize document format
        xz.txt: standardize document format
        xillybus.txt: standardize document format
        vfio.txt: standardize document format
        vfio-mediated-device.txt: standardize document format
        unaligned-memory-access.txt: standardize document format
        this_cpu_ops.txt: standardize document format
        svga.txt: standardize document format
        static-keys.txt: standardize document format
        smsc_ece1099.txt: standardize document format
        SM501.txt: standardize document format
        siphash.txt: standardize document format
        sgi-ioc4.txt: standardize document format
        SAK.txt: standardize document format
        rpmsg.txt: standardize document format
        robust-futexes.txt: standardize document format
        ...
      486088bc
    • Linus Torvalds's avatar
      Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random · 52f6c588
      Linus Torvalds authored
      Pull random updates from Ted Ts'o:
       "Add wait_for_random_bytes() and get_random_*_wait() functions so that
        callers can more safely get random bytes if they can block until the
        CRNG is initialized.
      
        Also print a warning if get_random_*() is called before the CRNG is
        initialized. By default, only one single-line warning will be printed
        per boot. If CONFIG_WARN_ALL_UNSEEDED_RANDOM is defined, then a
        warning will be printed for each function which tries to get random
        bytes before the CRNG is initialized. This can get spammy for certain
        architecture types, so it is not enabled by default"
      
      * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
        random: reorder READ_ONCE() in get_random_uXX
        random: suppress spammy warnings about unseeded randomness
        random: warn when kernel uses unseeded randomness
        net/route: use get_random_int for random counter
        net/neighbor: use get_random_u32 for 32-bit hash random
        rhashtable: use get_random_u32 for hash_rnd
        ceph: ensure RNG is seeded before using
        iscsi: ensure RNG is seeded before use
        cifs: use get_random_u32 for 32-bit lock random
        random: add get_random_{bytes,u32,u64,int,long,once}_wait family
        random: add wait_for_random_bytes() API
      52f6c588
    • Linus Torvalds's avatar
      Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 78dcf734
      Linus Torvalds authored
      Pull ->s_options removal from Al Viro:
       "Preparations for fsmount/fsopen stuff (coming next cycle). Everything
        gets moved to explicit ->show_options(), killing ->s_options off +
        some cosmetic bits around fs/namespace.c and friends. Basically, the
        stuff needed to work with fsmount series with minimum of conflicts
        with other work.
      
        It's not strictly required for this merge window, but it would reduce
        the PITA during the coming cycle, so it would be nice to have those
        bits and pieces out of the way"
      
      * 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        isofs: Fix isofs_show_options()
        VFS: Kill off s_options and helpers
        orangefs: Implement show_options
        9p: Implement show_options
        isofs: Implement show_options
        afs: Implement show_options
        affs: Implement show_options
        befs: Implement show_options
        spufs: Implement show_options
        bpf: Implement show_options
        ramfs: Implement show_options
        pstore: Implement show_options
        omfs: Implement show_options
        hugetlbfs: Implement show_options
        VFS: Don't use save/replace_mount_options if not using generic_show_options
        VFS: Provide empty name qstr
        VFS: Make get_filesystem() return the affected filesystem
        VFS: Clean up whitespace in fs/namespace.c and fs/super.c
        Provide a function to create a NUL-terminated string from unterminated data
      78dcf734
    • Linus Torvalds's avatar
      Merge branch 'work.__copy_to_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 93ff8185
      Linus Torvalds authored
      Pull more __copy_.._user elimination from Al Viro.
      
      * 'work.__copy_to_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        drm_dp_aux_dev: switch to read_iter/write_iter
      93ff8185
    • Linus Torvalds's avatar
      Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 89cbec71
      Linus Torvalds authored
      Pull uacess-unaligned removal from Al Viro:
       "That stuff had just one user, and an exotic one, at that - binfmt_flat
        on arm and m68k"
      
      * 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        kill {__,}{get,put}_user_unaligned()
        binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail
      89cbec71
    • Linus Torvalds's avatar
      Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 2173bd06
      Linus Torvalds authored
      Pull network field-by-field copy-in updates from Al Viro:
       "This part of the misc compat queue was held back for review from
        networking folks and since davem has jus ACKed those..."
      
      * 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        get_compat_bpf_fprog(): don't copyin field-by-field
        get_compat_msghdr(): get rid of field-by-field copyin
        copy_msghdr_from_user(): get rid of field-by-field copyin
      2173bd06
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 568d135d
      Linus Torvalds authored
      Pull MIPS updates from Ralf Baechle:
       "Boston platform support:
         - Document DT bindings
         - Add CLK driver for board clocks
      
        CM:
         - Avoid per-core locking with CM3 & higher
         - WARN on attempt to lock invalid VP, not BUG
      
        CPS:
         - Select CONFIG_SYS_SUPPORTS_SCHED_SMT for MIPSr6
         - Prevent multi-core with dcache aliasing
         - Handle cores not powering down more gracefully
         - Handle spurious VP starts more gracefully
      
        DSP:
         - Add lwx & lhx missaligned access support
      
        eBPF:
         - Add MIPS support along with many supporting change to add the
           required infrastructure
      
        Generic arch code:
         - Misc sysmips MIPS_ATOMIC_SET fixes
         - Drop duplicate HAVE_SYSCALL_TRACEPOINTS
         - Negate error syscall return in trace
         - Correct forced syscall errors
         - Traced negative syscalls should return -ENOSYS
         - Allow samples/bpf/tracex5 to access syscall arguments for sane
           traces
         - Cleanup from old Kconfig options in defconfigs
         - Fix PREF instruction usage by memcpy for MIPS R6
         - Fix various special cases in the FPU eulation
         - Fix some special cases in MIPS16e2 support
         - Fix MIPS I ISA /proc/cpuinfo reporting
         - Sort MIPS Kconfig alphabetically
         - Fix minimum alignment requirement of IRQ stack as required by
           ABI / GCC
         - Fix special cases in the module loader
         - Perform post-DMA cache flushes on systems with MAARs
         - Probe the I6500 CPU
         - Cleanup cmpxchg and add support for 1 and 2 byte operations
         - Use queued read/write locks (qrwlock)
         - Use queued spinlocks (qspinlock)
         - Add CPU shared FTLB feature detection
         - Handle tlbex-tlbp race condition
         - Allow storing pgd in C0_CONTEXT for MIPSr6
         - Use current_cpu_type() in m4kc_tlbp_war()
         - Support Boston in the generic kernel
      
        Generic platform:
         - yamon-dt: Pull YAMON DT shim code out of SEAD-3 board
         - yamon-dt: Support > 256MB of RAM
         - yamon-dt: Use serial* rather than uart* aliases
         - Abstract FDT fixup application
         - Set RTC_ALWAYS_BCD to 0
         - Add a MAINTAINERS entry
      
        core kernel:
         - qspinlock.c: include linux/prefetch.h
      
        Loongson 3:
         - Add support
      
        Perf:
         - Add I6500 support
      
        SEAD-3:
         - Remove GIC timer from DT
         - Set interrupt-parent per-device, not at root node
         - Fix GIC interrupt specifiers
      
        SMP:
         - Skip IPI setup if we only have a single CPU
      
        VDSO:
         - Make comment match reality
         - Improvements to time code in VDSO"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (86 commits)
        locking/qspinlock: Include linux/prefetch.h
        MIPS: Fix MIPS I ISA /proc/cpuinfo reporting
        MIPS: Fix minimum alignment requirement of IRQ stack
        MIPS: generic: Support MIPS Boston development boards
        MIPS: DTS: img: Don't attempt to build-in all .dtb files
        clk: boston: Add a driver for MIPS Boston board clocks
        dt-bindings: Document img,boston-clock binding
        MIPS: Traced negative syscalls should return -ENOSYS
        MIPS: Correct forced syscall errors
        MIPS: Negate error syscall return in trace
        MIPS: Drop duplicate HAVE_SYSCALL_TRACEPOINTS select
        MIPS16e2: Provide feature overrides for non-MIPS16 systems
        MIPS: MIPS16e2: Report ASE presence in /proc/cpuinfo
        MIPS: MIPS16e2: Subdecode extended LWSP/SWSP instructions
        MIPS: MIPS16e2: Identify ASE presence
        MIPS: VDSO: Fix a mismatch between comment and preprocessor constant
        MIPS: VDSO: Add implementation of gettimeofday() fallback
        MIPS: VDSO: Add implementation of clock_gettime() fallback
        MIPS: VDSO: Fix conversions in do_monotonic()/do_monotonic_coarse()
        MIPS: Use current_cpu_type() in m4kc_tlbp_war()
        ...
      568d135d
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 4ecd4ff5
      Linus Torvalds authored
      Pull UML updates from Richard Weinberger:
       "Mostly fixes for UML:
      
         - First round of fixes for PTRACE_GETRESET/SETREGSET
      
         - A printf vs printk cleanup
      
         - Minor improvements"
      
      * 'for-linus-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        um: Correctly check for PTRACE_GETRESET/SETREGSET
        um: v2: Use generic NOTES macro
        um: Add kerneldoc for userspace_tramp() and start_userspace()
        um: Add kerneldoc for segv_handler
        um: stub-data.h: remove superfluous include
        um: userspace - be more verbose in ptrace set regs error
        um: add dummy ioremap and iounmap functions
        um: Allow building and running on older hosts
        um: Avoid longjmp/setjmp symbol clashes with libpthread.a
        um: console: Ignore console= option
        um: Use os_warn to print out pre-boot warning/error messages
        um: Add os_warn() for pre-boot warning/error messages
        um: Use os_info for the messages on normal path
        um: Add os_info() for pre-boot information messages
        um: Use printk instead of printf in make_uml_dir
      4ecd4ff5
    • Linus Torvalds's avatar
      Merge tag 'upstream-4.13-rc1' of git://git.infradead.org/linux-ubifs · 966859b9
      Linus Torvalds authored
      Pull UBIFS updates from Richard Weinberger:
      
       - Updates and fixes for the file encryption mode
      
       - Minor improvements
      
       - Random fixes
      
      * tag 'upstream-4.13-rc1' of git://git.infradead.org/linux-ubifs:
        ubifs: Set double hash cookie also for RENAME_EXCHANGE
        ubifs: Massage assert in ubifs_xattr_set() wrt. init_xattrs
        ubifs: Don't leak kernel memory to the MTD
        ubifs: Change gfp flags in page allocation for bulk read
        ubifs: Fix oops when remounting with no_bulk_read.
        ubifs: Fail commit if TNC is obviously inconsistent
        ubifs: allow userspace to map mounts to volumes
        ubifs: Wire-up statx() support
        ubifs: Remove dead code from ubifs_get_link()
        ubifs: Massage debug prints wrt. fscrypt
        ubifs: Add assert to dent_key_init()
        ubifs: Fix unlink code wrt. double hash lookups
        ubifs: Fix data node size for truncating uncompressed nodes
        ubifs: Don't encrypt special files on creation
        ubifs: Fix memory leak in RENAME_WHITEOUT error path in do_rename
        ubifs: Fix inode data budget in ubifs_mknod
        ubifs: Correctly evict xattr inodes
        ubifs: Unexport ubifs_inode_slab
        ubifs: don't bother checking for encryption key in ->mmap()
        ubifs: require key for truncate(2) of encrypted file
      966859b9