Skip to content
  1. Jan 25, 2020
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · d5d359b0
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - add sanity checks to USB endpoints in various dirvers
      
       - max77650-onkey was missing an OF table which was preventing module
         autoloading
      
       - a revert and a different fix for F54 handling in Synaptics dirver
      
       - a fixup for handling register in pm8xxx vibrator driver
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: pm8xxx-vib - fix handling of separate enable register
        Input: keyspan-remote - fix control-message timeouts
        Input: max77650-onkey - add of_match table
        Input: rmi_f54 - read from FIFO in 32 byte blocks
        Revert "Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers"
        Input: sur40 - fix interface sanity checks
        Input: gtco - drop redundant variable reinit
        Input: gtco - fix extra-descriptor debug message
        Input: gtco - fix endpoint sanity check
        Input: aiptek - use descriptors of current altsetting
        Input: aiptek - fix endpoint sanity check
        Input: pegasus_notetaker - fix endpoint sanity check
        Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
        Input: evdev - convert kzalloc()/vzalloc() to kvzalloc()
      d5d359b0
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 6381b442
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
       "Two fixes:
      
         - Fix NULL-ptr dereference bug in Intel IOMMU driver
      
         - Properly save and restore AMD IOMMU performance counter registers
           when testing if they are writable"
      
      * tag 'iommu-fixes-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Fix IOMMU perf counter clobbering during init
        iommu/vt-d: Call __dmar_remove_one_dev_info with valid pointer
      6381b442
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 3c45d751
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Some more powerpc fixes for 5.5:
      
         - Fix our hash MMU code to avoid having overlapping ids between user
           and kernel, which isn't as bad as it sounds but led to crashes on
           some machines.
      
         - A fix for the Power9 XIVE interrupt code, which could return the
           wrong interrupt state in obscure error conditions.
      
         - A minor Kconfig fix for the recently added CONFIG_PPC_UV code.
      
        Thanks to Aneesh Kumar K.V, Bharata B Rao, Cédric Le Goater, Frederic
        Barrat"
      
      * tag 'powerpc-5.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/mm/hash: Fix sharing context ids between kernel & userspace
        powerpc/xive: Discard ESB load value when interrupt is invalid
        powerpc: Ultravisor: Fix the dependencies for CONFIG_PPC_UV
      3c45d751
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2020-01-24' of git://anongit.freedesktop.org/drm/drm · 274adbff
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This one has a core mst fix and two i915 fixes. amdgpu just enables
        some hw outside experimental.
      
        The panfrost fix is a little bigger than I'd like at this stage but it
        fixes a fairly fundamental problem with global shared buffers in that
        driver, and since it's confined to that driver and I've taken a look
        at it, I think it's fine to get into the tree now, so it can get
        stable propagated as well.
      
        core/mst:
         - Fix SST branch device handling
      
        amdgpu:
         - enable renoir outside experimental
      
        i915:
         - Avoid overflow with huge userptr objects
         - uAPI fix to correctly handle negative values in
           engine->uabi_class/instance (cc: stable)
      
        panfrost:
         - Fix mapping of globally visible BO's (Boris)"
      
      * tag 'drm-fixes-2020-01-24' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu: remove the experimental flag for renoir
        drm/panfrost: Add the panfrost_gem_mapping concept
        drm/i915: Align engine->uabi_class/instance with i915_drm.h
        drm/i915/userptr: fix size calculation
        drm/dp_mst: Handle SST-only branch device case
      274adbff
    • Christophe Leroy's avatar
      lib: Reduce user_access_begin() boundaries in strncpy_from_user() and strnlen_user() · ab10ae1c
      Christophe Leroy authored
      
      
      The range passed to user_access_begin() by strncpy_from_user() and
      strnlen_user() starts at 'src' and goes up to the limit of userspace
      although reads will be limited by the 'count' param.
      
      On 32 bits powerpc (book3s/32) access has to be granted for each
      256Mbytes segment and the cost increases with the number of segments to
      unlock.
      
      Limit the range with 'count' param.
      
      Fixes: 594cc251 ("make 'user_access_begin()' do 'access_ok()'")
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab10ae1c
  2. Jan 24, 2020
  3. Jan 23, 2020
  4. Jan 22, 2020
  5. Jan 21, 2020
    • Tvrtko Ursulin's avatar
      drm/i915: Align engine->uabi_class/instance with i915_drm.h · 5eec7182
      Tvrtko Ursulin authored
      
      
      In our ABI we have defined I915_ENGINE_CLASS_INVALID_NONE and
      I915_ENGINE_CLASS_INVALID_VIRTUAL as negative values which creates
      implicit coupling with type widths used in, also ABI, struct
      i915_engine_class_instance.
      
      One place where we export engine->uabi_class
      I915_ENGINE_CLASS_INVALID_VIRTUAL is from our our tracepoints. Because the
      type of the former is u8 in contrast to u16 defined in the ABI, 254 will
      be returned instead of 65534 which userspace would legitimately expect.
      
      Another place is I915_CONTEXT_PARAM_ENGINES.
      
      Therefore we need to align the type used to store engine ABI class and
      instance.
      
      v2:
       * Update the commit message mentioning get_engines and cc stable.
         (Chris)
      
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: 6d06779e ("drm/i915: Load balancing across a virtual engine")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: <stable@vger.kernel.org> # v5.3+
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200116134508.25211-1-tvrtko.ursulin@linux.intel.com
      
      
      (cherry picked from commit 0b3bd0cd)
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      5eec7182
    • Matthew Auld's avatar
      drm/i915/userptr: fix size calculation · ecc4d2a5
      Matthew Auld authored
      
      
      If we create a rather large userptr object(e.g 1ULL << 32) we might
      shift past the type-width of num_pages: (int)num_pages << PAGE_SHIFT,
      resulting in a totally bogus sg_table, which fortunately will eventually
      manifest as:
      
      gen8_ppgtt_insert_huge:463 GEM_BUG_ON(iter->sg->length < page_size)
      kernel BUG at drivers/gpu/drm/i915/gt/gen8_ppgtt.c:463!
      
      v2: more unsigned long
          prefer I915_GTT_PAGE_SIZE
      
      Fixes: 5cc9ed4b ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200117132413.1170563-2-matthew.auld@intel.com
      
      
      (cherry picked from commit 8e78871b)
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      ecc4d2a5
    • Stephan Gerhold's avatar
      Input: pm8xxx-vib - fix handling of separate enable register · 996d5d5f
      Stephan Gerhold authored
      
      
      Setting the vibrator enable_mask is not implemented correctly:
      
      For regmap_update_bits(map, reg, mask, val) we give in either
      regs->enable_mask or 0 (= no-op) as mask and "val" as value.
      But "val" actually refers to the vibrator voltage control register,
      which has nothing to do with the enable_mask.
      
      So we usually end up doing nothing when we really wanted
      to enable the vibrator.
      
      We want to set or clear the enable_mask (to enable/disable the vibrator).
      Therefore, change the call to always modify the enable_mask
      and set the bits only if we want to enable the vibrator.
      
      Fixes: d4c7c5c9 ("Input: pm8xxx-vib - handle separate enable register")
      Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Link: https://lore.kernel.org/r/20200114183442.45720-1-stephan@gerhold.net
      
      
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      996d5d5f
    • Eugene Syromiatnikov's avatar
      io_uring: fix compat for IORING_REGISTER_FILES_UPDATE · 1292e972
      Eugene Syromiatnikov authored
      
      
      fds field of struct io_uring_files_update is problematic with regards
      to compat user space, as pointer size is different in 32-bit, 32-on-64-bit,
      and 64-bit user space.  In order to avoid custom handling of compat in
      the syscall implementation, make fds __u64 and use u64_to_user_ptr in
      order to retrieve it.  Also, align the field naturally and check that
      no garbage is passed there.
      
      Fixes: c3a31e60 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE")
      Signed-off-by: default avatarEugene Syromiatnikov <esyr@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1292e972
    • Masami Ichikawa's avatar
      tracing: Do not set trace clock if tracefs lockdown is in effect · bf24daac
      Masami Ichikawa authored
      When trace_clock option is not set and unstable clcok detected,
      tracing_set_default_clock() sets trace_clock(ThinkPad A285 is one of
      case). In that case, if lockdown is in effect, null pointer
      dereference error happens in ring_buffer_set_clock().
      
      Link: http://lkml.kernel.org/r/20200116131236.3866925-1-masami256@gmail.com
      
      Cc: stable@vger.kernel.org
      Fixes: 17911ff3 ("tracing: Add locked_down checks to the open calls of files created for tracefs")
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788488
      
      
      Signed-off-by: default avatarMasami Ichikawa <masami256@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      bf24daac
    • Steven Rostedt (VMware)'s avatar
      tracing: Fix histogram code when expression has same var as value · 8bcebc77
      Steven Rostedt (VMware) authored
      While working on a tool to convert SQL syntex into the histogram language of
      the kernel, I discovered the following bug:
      
       # echo 'first u64 start_time u64 end_time pid_t pid u64 delta' >> synthetic_events
       # echo 'hist:keys=pid:start=common_timestamp' > events/sched/sched_waking/trigger
       # echo 'hist:keys=next_pid:delta=common_timestamp-$start,start2=$start:onmatch(sched.sched_waking).trace(first,$start2,common_timestamp,next_pid,$delta)' > events/sched/sched_switch/trigger
      
      Would not display any histograms in the sched_switch histogram side.
      
      But if I were to swap the location of
      
        "delta=common_timestamp-$start" with "start2=$start"
      
      Such that the last line had:
      
       # echo 'hist:keys=next_pid:start2=$start,delta=common_timestamp-$start:onmatch(sched.sched_waking).trace(first,$start2,common_timestamp,next_pid,$delta)' > events/sched/sched_switch/trigger
      
      The histogram works as expected.
      
      What I found out is that the expressions clear out the value once it is
      resolved. As the variables are resolved in the order listed, when
      processing:
      
        delta=common_timestamp-$start
      
      The $start is cleared. When it gets to "start2=$start", it errors out with
      "unresolved symbol" (which is silent as this happens at the location of the
      trace), and the histogram is dropped.
      
      When processing the histogram for variable references, instead of adding a
      new reference for a variable used twice, use the same reference. That way,
      not only is it more efficient, but the order will no longer matter in
      processing of the variables.
      
      From Tom Zanussi:
      
       "Just to clarify some more about what the problem was is that without
        your patch, we would have two separate references to the same variable,
        and during resolve_var_refs(), they'd both want to be resolved
        separately, so in this case, since the first reference to start wasn't
        part of an expression, it wouldn't get the read-once flag set, so would
        be read normally, and then the second reference would do the read-once
        read and also be read but using read-once.  So everything worked and
        you didn't see a problem:
      
         from: start2=$start,delta=common_timestamp-$start
      
        In the second case, when you switched them around, the first reference
        would be resolved by doing the read-once, and following that the second
        reference would try to resolve and see that the variable had already
        been read, so failed as unset, which caused it to short-circuit out and
        not do the trigger action to generate the synthetic event:
      
         to: delta=common_timestamp-$start,start2=$start
      
        With your patch, we only have the single resolution which happens
        correctly the one time it's resolved, so this can't happen."
      
      Link: https://lore.kernel.org/r/20200116154216.58ca08eb@gandalf.local.home
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: 067fe038 ("tracing: Add variable reference handling to hist triggers")
      Reviewed-by: default avatarTom Zanuss <zanussi@kernel.org>
      Tested-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      8bcebc77