Skip to content
  1. Jul 28, 2020
    • Steve Cohen's avatar
      drm: hold gem reference until object is no longer accessed · 8490d6a7
      Steve Cohen authored
      
      
      A use-after-free in drm_gem_open_ioctl can happen if the
      GEM object handle is closed between the idr lookup and
      retrieving the size from said object since a local reference
      is not being held at that point. Hold the local reference
      while the object can still be accessed to fix this and
      plug the potential security hole.
      
      Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1595284250-31580-1-git-send-email-cohens@codeaurora.org
      8490d6a7
    • Paul Cercueil's avatar
      drm/dbi: Fix SPI Type 1 (9-bit) transfer · 900ab59e
      Paul Cercueil authored
      The function mipi_dbi_spi1_transfer() will transfer its payload as 9-bit
      data, the 9th (MSB) bit being the data/command bit. In order to do that,
      it unpacks the 8-bit values into 16-bit values, then sets the 9th bit if
      the byte corresponds to data, clears it otherwise. The 7 MSB are
      padding. The array of now 16-bit values is then passed to the SPI core
      for transfer.
      
      This function was broken since its introduction, as the length of the
      SPI transfer was set to the payload size before its conversion, but the
      payload doubled in size due to the 8-bit -> 16-bit conversion.
      
      Fixes: 02dd95fe
      
       ("drm/tinydrm: Add MIPI DBI support")
      Cc: <stable@vger.kernel.org> # 5.4+
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200703141341.1266263-1-paul@crapouillou.net
      900ab59e
  2. Jul 27, 2020
    • Sam Ravnborg's avatar
      drm/drm_fb_helper: fix fbdev with sparc64 · 2a1658bf
      Sam Ravnborg authored
      Recent kernels have been reported to panic using the bochs_drm
      framebuffer under qemu-system-sparc64 which was bisected to
      commit 7a0483ac
      
       ("drm/bochs: switch to generic drm fbdev emulation").
      
      The backtrace indicates that the shadow framebuffer copy in
      drm_fb_helper_dirty_blit_real() is trying to access the real
      framebuffer using a virtual address rather than use an IO access
      typically implemented using a physical (ASI_PHYS) access on SPARC.
      
      The fix is to replace the memcpy with memcpy_toio() from io.h.
      
      memcpy_toio() uses writeb() where the original fbdev code
      used sbus_memcpy_toio(). The latter uses sbus_writeb().
      
      The difference between writeb() and sbus_memcpy_toio() is
      that writeb() writes bytes in little-endian, where sbus_writeb() writes
      bytes in big-endian. As endian does not matter for byte writes they are
      the same. So we can safely use memcpy_toio() here.
      
      Note that this only fixes bochs, in general fbdev helpers still have
      issues with mixing up system memory and __iomem space. Fixing that will
      require a lot more work.
      
      v3:
        - Improved changelog (Daniel)
        - Added FIXME to fbdev_use_iomem (Daniel)
      
      v2:
        - Added missing __iomem cast (kernel test robot)
        - Made changelog readable and fix typos (Mark)
        - Add flag to select iomem - and set it in the bochs driver
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Reported-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Tested-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: sparclinux@vger.kernel.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200709193016.291267-1-sam@ravnborg.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200725191012.GA434957@ravnborg.org
      2a1658bf
    • Linus Walleij's avatar
      drm/mcde: Fix stability issue · aa7bf898
      Linus Walleij authored
      
      
      Whenever a display update was sent, apart from updating
      the memory base address, we called mcde_display_send_one_frame()
      which also sent a command to the display requesting the TE IRQ
      and enabling the FIFO.
      
      When continuous updates are running this is wrong: we need
      to only send this to start the flow to the display on
      the very first update. This lead to the display pipeline
      locking up and crashing.
      
      Check if the flow is already running and in that case
      do not call mcde_display_send_one_frame().
      
      This fixes crashes on the Samsung GT-S7710 (Skomer).
      
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Acked-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Cc: Stephan Gerhold <stephan@gerhold.net>
      Cc: stable@vger.kernel.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200718233323.3407670-1-linus.walleij@linaro.org
      aa7bf898
    • Guido Günther's avatar
      drm/bridge: nwl-dsi: Drop DRM_BRIDGE_ATTACH_NO_CONNECTOR check. · 07c08f52
      Guido Günther authored
      
      
      We don't create a connector but let panel_bridge handle that so there's
      no point in rejecting DRM_BRIDGE_ATTACH_NO_CONNECTOR.
      
      Signed-off-by: default avatarGuido Günther <agx@sigxcpu.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/8b6545b991afce6add0a24f5f5d116778b0cb763.1595096667.git.agx@sigxcpu.org
      07c08f52
    • Jitao Shi's avatar
      drm/panel: Fix auo, kd101n80-45na horizontal noise on edges of panel · d76acc9f
      Jitao Shi authored
      
      
      Fine tune the HBP and HFP to avoid the dot noise on the left and right edges.
      
      Signed-off-by: default avatarJitao Shi <jitao.shi@mediatek.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200714123332.37609-1-jitao.shi@mediatek.com
      d76acc9f
    • Douglas Anderson's avatar
      drm: panel: simple: Delay HPD checking on boe_nv133fhm_n61 for 15 ms · 667d73d7
      Douglas Anderson authored
      
      
      On boe_nv133fhm_n62 (and presumably on boe_nv133fhm_n61) a scope shows
      a small spike on the HPD line right when you power the panel on.  The
      picture looks something like this:
      
               +--------------------------------------
               |
               |
               |
      Power ---+
                                                 +---
                                                 |
                    ++                           |
               +----+|                           |
      HPD -----+     +---------------------------+
      
      So right when power is applied there's a little bump in HPD and then
      there's small spike right before it goes low.  The total time of the
      little bump plus the spike was measured on one panel as being 8 ms
      long.  The total time for the HPD to go high on the same panel was
      51.2 ms, though the datasheet only promises it is < 200 ms.
      
      When asked about this glitch, BOE indicated that it was expected and
      persisted until the TCON has been initialized.
      
      If this was a real hotpluggable DP panel then this wouldn't matter a
      whole lot.  We'd debounce the HPD signal for a really long time and so
      the little blip wouldn't hurt.  However, this is not a hotpluggable DP
      panel and the the debouncing logic isn't needed and just shows down
      the time needed to get the display working.  This is why the code in
      panel_simple_prepare() doesn't do debouncing and just waits for HPD to
      go high once.  Unfortunately if we get unlucky and happen to poll the
      HPD line right at the spike we can try talking to the panel before
      it's ready.
      
      Let's handle this situation by putting in a 15 ms prepare delay and
      decreasing the "hpd absent delay" by 15 ms.  That means:
      * If you don't have HPD hooked up at all you've still got the
        hardcoded 200 ms delay.
      * If you've got HPD hooked up you will always wait at least 15 ms
        before checking HPD.  The only case where this could be bad is if
        the panel is sharing a voltage rail with something else in the
        system and was already turned on long before the panel came up.  In
        such a case we'll be delaying 15 ms for no reason, but it's not a
        huge delay and I don't see any other good solution to handle that
        case.
      
      Even though the delay was measured as 8 ms, 15 ms was chosen to give a
      bit of margin.
      
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200716132120.1.I01e738cd469b61fc9b28b3ef1c6541a4f48b11bf@changeid
      667d73d7
    • Laurentiu Palcu's avatar
      drm/bridge/adv7511: set the bridge type properly · f10761c9
      Laurentiu Palcu authored
      
      
      After the drm_bridge_connector_init() helper function has been added,
      the ADV driver has been changed accordingly. However, the 'type'
      field of the bridge structure was left unset, which makes the helper
      function always return -EINVAL.
      
      Signed-off-by: default avatarLaurentiu Palcu <laurentiu.palcu@nxp.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarVinod Koul <vkoul@kernel.org>
      Tested-by: Vinod Koul <vkoul@kernel.org> # tested on DragonBoard 410c
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200720124228.12552-1-laurentiu.palcu@oss.nxp.com
      f10761c9
    • Biju Das's avatar
      drm: of: Fix double-free bug · 4ee48cc5
      Biju Das authored
      Fix double-free bug in the error path.
      
      Fixes: 65290075
      
       ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order")
      Reported-by: default avatarPavel Machek <pavel@denx.de>
      Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1595502654-40595-1-git-send-email-biju.das.jz@bp.renesas.com
      4ee48cc5
  3. Jul 20, 2020
    • Qiang Yu's avatar
      drm/lima: fix wait pp reset timeout · f3f90c6d
      Qiang Yu authored
      PP bcast is marked as doing async reset after job is done.
      When resume after suspend, each PP is reset individually,
      so no need to reset in PP bcast resume. But I forgot to
      clear the PP bcast async reset mark so call into async wait
      before job run and gets timeout.
      
      Closes: https://gitlab.freedesktop.org/lima/linux/-/issues/34
      Fixes: 3446d7e9
      
       ("drm/lima: add resume/suspend callback for each ip")
      Reviewed-by: default avatarErico Nunes <nunes.erico@gmail.com>
      Signed-off-by: default avatarQiang Yu <yuq825@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200719073050.776962-1-yuq825@gmail.com
      f3f90c6d
  4. Jul 17, 2020
  5. Jul 10, 2020
    • Charan Teja Kalla's avatar
      dmabuf: use spinlock to access dmabuf->name · 6348dd29
      Charan Teja Kalla authored
      
      
      There exists a sleep-while-atomic bug while accessing the dmabuf->name
      under mutex in the dmabuffs_dname(). This is caused from the SELinux
      permissions checks on a process where it tries to validate the inherited
      files from fork() by traversing them through iterate_fd() (which
      traverse files under spin_lock) and call
      match_file(security/selinux/hooks.c) where the permission checks happen.
      This audit information is logged using dump_common_audit_data() where it
      calls d_path() to get the file path name. If the file check happen on
      the dmabuf's fd, then it ends up in ->dmabuffs_dname() and use mutex to
      access dmabuf->name. The flow will be like below:
      flush_unauthorized_files()
        iterate_fd()
          spin_lock() --> Start of the atomic section.
            match_file()
              file_has_perm()
                avc_has_perm()
                  avc_audit()
                    slow_avc_audit()
      	        common_lsm_audit()
      		  dump_common_audit_data()
      		    audit_log_d_path()
      		      d_path()
                              dmabuffs_dname()
                                mutex_lock()--> Sleep while atomic.
      
      Call trace captured (on 4.19 kernels) is below:
      ___might_sleep+0x204/0x208
      __might_sleep+0x50/0x88
      __mutex_lock_common+0x5c/0x1068
      __mutex_lock_common+0x5c/0x1068
      mutex_lock_nested+0x40/0x50
      dmabuffs_dname+0xa0/0x170
      d_path+0x84/0x290
      audit_log_d_path+0x74/0x130
      common_lsm_audit+0x334/0x6e8
      slow_avc_audit+0xb8/0xf8
      avc_has_perm+0x154/0x218
      file_has_perm+0x70/0x180
      match_file+0x60/0x78
      iterate_fd+0x128/0x168
      selinux_bprm_committing_creds+0x178/0x248
      security_bprm_committing_creds+0x30/0x48
      install_exec_creds+0x1c/0x68
      load_elf_binary+0x3a4/0x14e0
      search_binary_handler+0xb0/0x1e0
      
      So, use spinlock to access dmabuf->name to avoid sleep-while-atomic.
      
      Cc: <stable@vger.kernel.org> [5.3+]
      Signed-off-by: default avatarCharan Teja Kalla <charante@codeaurora.org>
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
       [sumits: added comment to spinlock_t definition to avoid warning]
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/a83e7f0d-4e54-9848-4b58-e1acdbe06735@codeaurora.org
      6348dd29
  6. Jul 09, 2020
    • Guenter Roeck's avatar
      drm/aspeed: Call drm_fbdev_generic_setup after drm_dev_register · 22493574
      Guenter Roeck authored
      The following backtrace is seen when running aspeed G5 kernels.
      
      WARNING: CPU: 0 PID: 1 at drivers/gpu/drm/drm_fb_helper.c:2233 drm_fbdev_generic_setup+0x138/0x198
      aspeed_gfx 1e6e6000.display: Device has not been registered.
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.0-rc3 #1
      Hardware name: Generic DT based system
      Backtrace:
      [<8010d6d0>] (dump_backtrace) from [<8010d9b8>] (show_stack+0x20/0x24)
      r7:00000009 r6:60000153 r5:00000000 r4:8119fa94
      [<8010d998>] (show_stack) from [<80b8cb98>] (dump_stack+0xcc/0xec)
      [<80b8cacc>] (dump_stack) from [<80123ef0>] (__warn+0xd8/0xfc)
      r7:00000009 r6:80e62ed0 r5:00000000 r4:974c3ccc
      [<80123e18>] (__warn) from [<80123f98>] (warn_slowpath_fmt+0x84/0xc4)
      r9:00000009 r8:806a0140 r7:000008b9 r6:80e62ed0 r5:80e631f8 r4:974c2000
      [<80123f18>] (warn_slowpath_fmt) from [<806a0140>] (drm_fbdev_generic_setup+0x138/0x198)
      r9:00000001 r8:9758fc10 r7:9758fc00 r6:00000000 r5:00000020 r4:9768a000
      [<806a0008>] (drm_fbdev_generic_setup) from [<806d4558>] (aspeed_gfx_probe+0x204/0x32c)
      r7:9758fc00 r6:00000000 r5:00000000 r4:9768a000
      [<806d4354>] (aspeed_gfx_probe) from [<806dfca0>] (platform_drv_probe+0x58/0xa8)
      
      Since commit 1aed9509 ("drm/fb-helper: Remove return value from
      drm_fbdev_generic_setup()"), drm_fbdev_generic_setup() must be called
      after drm_dev_register() to avoid the warning. Do that.
      
      Fixes: 1aed9509
      
       ("drm/fb-helper: Remove return value from drm_fbdev_generic_setup()")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Acked-by: default avatarJoel Stanley <joel@jms.id.au>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200701001002.74997-1-linux@roeck-us.net
      22493574
  7. Jul 08, 2020
    • Zenghui Yu's avatar
      drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat · 00debf81
      Zenghui Yu authored
      The HiSilicon hibmc driver triggers a splat at boot time as below
      
      [   14.137806] ------------[ cut here ]------------
      [   14.142405] hibmc-drm 0000:0a:00.0: Device has not been registered.
      [   14.148661] WARNING: CPU: 0 PID: 496 at drivers/gpu/drm/drm_fb_helper.c:2233 drm_fbdev_generic_setup+0x15c/0x1b8
      [   14.158787] [...]
      [   14.278307] Call trace:
      [   14.280742]  drm_fbdev_generic_setup+0x15c/0x1b8
      [   14.285337]  hibmc_pci_probe+0x354/0x418
      [   14.289242]  local_pci_probe+0x44/0x98
      [   14.292974]  work_for_cpu_fn+0x20/0x30
      [   14.296708]  process_one_work+0x1c4/0x4e0
      [   14.300698]  worker_thread+0x2c8/0x528
      [   14.304431]  kthread+0x138/0x140
      [   14.307646]  ret_from_fork+0x10/0x18
      [   14.311205] ---[ end trace a2000ec2d838af4d ]---
      
      This turned out to be due to the fbdev device hasn't been registered when
      drm_fbdev_generic_setup() is invoked. Let's fix the splat by moving it down
      after drm_dev_register() which will follow the "Display driver example"
      documented by commit de99f060
      
       ("drm/drv: DOC: Add driver example
      code").
      
      Signed-off-by: default avatarZenghui Yu <yuzenghui@huawei.com>
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarXinliang Liu <xinliang.liu@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200706144713.1123-1-yuzenghui@huawei.com
      00debf81
  8. Jul 02, 2020
  9. Jun 30, 2020
    • Chen-Yu Tsai's avatar
      drm: sun4i: hdmi: Remove extra HPD polling · bda8eaa6
      Chen-Yu Tsai authored
      The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more
      or less an input-only GPIO. Other GPIO-based HPD implementations
      directly return the current state, instead of polling for a specific
      state and returning the other if that times out.
      
      Remove the I/O polling from sun4i_hdmi_connector_detect() and directly
      return a known state based on the current reading. This also gets rid
      of excessive CPU usage by kworker as reported on Stack Exchange [1] and
      Armbian forums [2].
      
       [1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi
       [2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/
      
      Fixes: 9c568101
      
       ("drm/sun4i: Add HDMI support")
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200629060032.24134-1-wens@kernel.org
      bda8eaa6
  10. Jun 25, 2020
    • Sumit Semwal's avatar
      dma-buf: Move dma_buf_release() from fops to dentry_ops · 4ab59c3c
      Sumit Semwal authored
      Charan Teja reported a 'use-after-free' in dmabuffs_dname [1], which
      happens if the dma_buf_release() is called while the userspace is
      accessing the dma_buf pseudo fs's dmabuffs_dname() in another process,
      and dma_buf_release() releases the dmabuf object when the last reference
      to the struct file goes away.
      
      I discussed with Arnd Bergmann, and he suggested that rather than tying
      the dma_buf_release() to the file_operations' release(), we can tie it to
      the dentry_operations' d_release(), which will be called when the last ref
      to the dentry is removed.
      
      The path exercised by __fput() calls f_op->release() first, and then calls
      dput, which eventually calls d_op->d_release().
      
      In the 'normal' case, when no userspace access is happening via dma_buf
      pseudo fs, there should be exactly one fd, file, dentry and inode, so
      closing the fd will kill of everything right away.
      
      In the presented case, the dentry's d_release() will be called only when
      the dentry's last ref is released.
      
      Therefore, lets move dma_buf_release() from fops->release() to
      d_ops->d_release()
      
      Many thanks to Arnd for his FS insights :)
      
      [1]: https://lore.kernel.org/patchwork/patch/1238278/
      
      Fixes: bb2bb903
      
       ("dma-buf: add DMA_BUF_SET_NAME ioctls")
      Reported-by: default avatar <syzbot+3643a18836bce555bff6@syzkaller.appspotmail.com>
      Cc: <stable@vger.kernel.org> [5.3+]
      Cc: Arnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Tested-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200611114418.19852-1-sumit.semwal@linaro.org
      4ab59c3c
    • Daniel Vetter's avatar
      drm/fb-helper: Fix vt restore · dc5bdb68
      Daniel Vetter authored
      
      
      In the past we had a pile of hacks to orchestrate access between fbdev
      emulation and native kms clients. We've tried to streamline this, by
      always preferring the kms side above fbdev calls when a drm master
      exists, because drm master controls access to the display resources.
      
      Unfortunately this breaks existing userspace, specifically Xorg. When
      exiting Xorg first restores the console to text mode using the KDSET
      ioctl on the vt. This does nothing, because a drm master is still
      around. Then it drops the drm master status, which again does nothing,
      because logind is keeping additional drm fd open to be able to
      orchestrate vt switches. In the past this is the point where fbdev was
      restored, as part of the ->lastclose hook on the drm side.
      
      Now to fix this regression we don't want to go back to letting fbdev
      restore things whenever it feels like, or to the pile of hacks we've
      had before. Instead try and go with a minimal exception to make the
      KDSET case work again, and nothing else.
      
      This means that if userspace does a KDSET call when switching between
      graphical compositors, there will be some flickering with fbcon
      showing up for a bit. But a) that's not a regression and b) userspace
      can fix it by improving the vt switching dance - logind should have
      all the information it needs.
      
      While pondering all this I'm also wondering wheter we should have a
      SWITCH_MASTER ioctl to allow race-free master status handover. But
      that's for another day.
      
      v2: Somehow forgot to cc all the fbdev people.
      
      v3: Fix typo Alex spotted.
      
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208179
      Cc: shlomo@fastmail.com
      Reported-and-Tested-by: default avatar <shlomo@fastmail.com>
      Cc: Michel Dänzer <michel@daenzer.net>
      Fixes: 64914da2
      
       ("drm/fbdev-helper: don't force restores")
      Cc: Noralf Trønnes <noralf@tronnes.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v5.7+
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Nathan Chancellor <natechancellor@gmail.com>
      Cc: Qiujun Huang <hqjagain@gmail.com>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200624092910.3280448-1-daniel.vetter@ffwll.ch
      dc5bdb68
  11. Jun 24, 2020
  12. Jun 23, 2020
  13. Jun 21, 2020
  14. Jun 17, 2020
    • Linus Walleij's avatar
      drm: mcde: Fix forgotten user of drm->dev_private · b48fd568
      Linus Walleij authored
      Unable to handle kernel NULL pointer dereference at virtual address 00000918
      pgd = (ptrval)
      [00000918] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-15001-gfa384b50b96b-dirty #514
      Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
      PC is at mcde_display_enable+0x78/0x7c0
      LR is at mcde_display_enable+0x78/0x7c0
      
      Fix this by using to_mcde() as in other functions.
      
      Fixes: fd7ee85c
      
       ("drm/mcde: Don't use drm_device->dev_private")
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200613223027.4189309-2-linus.walleij@linaro.org
      b48fd568
    • Linus Walleij's avatar
      drm: mcde: Fix display initialization problem · b984b6d8
      Linus Walleij authored
      
      
      The following bug appeared in the MCDE driver/display
      initialization during the recent merge window.
      
      First the place we call drm_fbdev_generic_setup() in the
      wrong place: this needs to be called AFTER calling
      drm_dev_register() else we get this splat:
      
       ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at ../drivers/gpu/drm/drm_fb_helper.c:2198 drm_fbdev_generic_setup+0x164/0x1a8
      mcde a0350000.mcde: Device has not been registered.
      Modules linked in:
      Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
      [<c010e704>] (unwind_backtrace) from [<c010a86c>] (show_stack+0x10/0x14)
      [<c010a86c>] (show_stack) from [<c0414f38>] (dump_stack+0x9c/0xb0)
      [<c0414f38>] (dump_stack) from [<c0121c8c>] (__warn+0xb8/0xd0)
      [<c0121c8c>] (__warn) from [<c0121d18>] (warn_slowpath_fmt+0x74/0xb8)
      [<c0121d18>] (warn_slowpath_fmt) from [<c04b154c>] (drm_fbdev_generic_setup+0x164/0x1a8)
      [<c04b154c>] (drm_fbdev_generic_setup) from [<c04ed278>] (mcde_drm_bind+0xc4/0x160)
      [<c04ed278>] (mcde_drm_bind) from [<c04f06b8>] (try_to_bring_up_master+0x15c/0x1a4)
      (...)
      
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200613223027.4189309-1-linus.walleij@linaro.org
      b984b6d8
  15. Jun 16, 2020
  16. Jun 15, 2020
    • Xiyu Yang's avatar
      drm/ttm: Fix dma_fence refcnt leak when adding move fence · 11425c45
      Xiyu Yang authored
      
      
      ttm_bo_add_move_fence() invokes dma_fence_get(), which returns a
      reference of the specified dma_fence object to "fence" with increased
      refcnt.
      
      When ttm_bo_add_move_fence() returns, local variable "fence" becomes
      invalid, so the refcount should be decreased to keep refcount balanced.
      
      The reference counting issue happens in one exception handling path of
      ttm_bo_add_move_fence(). When no_wait_gpu flag is equals to true, the
      function forgets to decrease the refcnt increased by dma_fence_get(),
      causing a refcnt leak.
      
      Fix this issue by calling dma_fence_put() when no_wait_gpu flag is
      equals to true.
      
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Link: https://patchwork.freedesktop.org/patch/370221/
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      11425c45
    • Xiyu Yang's avatar
      drm/ttm: Fix dma_fence refcnt leak in ttm_bo_vm_fault_reserved · 37cc4b95
      Xiyu Yang authored
      
      
      ttm_bo_vm_fault_reserved() invokes dma_fence_get(), which returns a
      reference of the specified dma_fence object to "moving" with increased
      refcnt.
      
      When ttm_bo_vm_fault_reserved() returns, local variable "moving" becomes
      invalid, so the refcount should be decreased to keep refcount balanced.
      
      The reference counting issue happens in several exception handling paths
      of ttm_bo_vm_fault_reserved(). When those error scenarios occur such as
      "err" equals to -EBUSY, the function forgets to decrease the refcnt
      increased by dma_fence_get(), causing a refcnt leak.
      
      Fix this issue by calling dma_fence_put() when no_wait_gpu flag is
      equals to true.
      
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Link: https://patchwork.freedesktop.org/patch/370219/
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      37cc4b95
    • Linus Torvalds's avatar
      Linux 5.8-rc1 · b3a9e3b9
      Linus Torvalds authored
      v5.8-rc1
      b3a9e3b9
    • Linus Torvalds's avatar
      Merge tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux · 4a87b197
      Linus Torvalds authored
      Pull SafeSetID update from Micah Morton:
       "Add additional LSM hooks for SafeSetID
      
        SafeSetID is capable of making allow/deny decisions for set*uid calls
        on a system, and we want to add similar functionality for set*gid
        calls.
      
        The work to do that is not yet complete, so probably won't make it in
        for v5.8, but we are looking to get this simple patch in for v5.8
        since we have it ready.
      
        We are planning on the rest of the work for extending the SafeSetID
        LSM being merged during the v5.9 merge window"
      
      * tag 'LSM-add-setgid-hook-5.8-author-fix' of git://github.com/micah-morton/linux:
        security: Add LSM hooks to set*gid syscalls
      4a87b197
    • Thomas Cedeno's avatar
      security: Add LSM hooks to set*gid syscalls · 39030e13
      Thomas Cedeno authored
      
      
      The SafeSetID LSM uses the security_task_fix_setuid hook to filter
      set*uid() syscalls according to its configured security policy. In
      preparation for adding analagous support in the LSM for set*gid()
      syscalls, we add the requisite hook here. Tested by putting print
      statements in the security_task_fix_setgid hook and seeing them get hit
      during kernel boot.
      
      Signed-off-by: default avatarThomas Cedeno <thomascedeno@google.com>
      Signed-off-by: default avatarMicah Morton <mortonm@chromium.org>
      39030e13
    • Linus Torvalds's avatar
      Merge tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 9d645db8
      Linus Torvalds authored
      Pull btrfs updates from David Sterba:
       "This reverts the direct io port to iomap infrastructure of btrfs
        merged in the first pull request. We found problems in invalidate page
        that don't seem to be fixable as regressions or without changing iomap
        code that would not affect other filesystems.
      
        There are four reverts in total, but three of them are followup
        cleanups needed to revert a43a67a2 cleanly. The result is the
        buffer head based implementation of direct io.
      
        Reverts are not great, but under current circumstances I don't see
        better options"
      
      * tag 'for-5.8-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Revert "btrfs: switch to iomap_dio_rw() for dio"
        Revert "fs: remove dio_end_io()"
        Revert "btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK"
        Revert "btrfs: split btrfs_direct_IO to read and write part"
      9d645db8
  17. Jun 14, 2020
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 96144c58
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix cfg80211 deadlock, from Johannes Berg.
      
       2) RXRPC fails to send norigications, from David Howells.
      
       3) MPTCP RM_ADDR parsing has an off by one pointer error, fix from
          Geliang Tang.
      
       4) Fix crash when using MSG_PEEK with sockmap, from Anny Hu.
      
       5) The ucc_geth driver needs __netdev_watchdog_up exported, from
          Valentin Longchamp.
      
       6) Fix hashtable memory leak in dccp, from Wang Hai.
      
       7) Fix how nexthops are marked as FDB nexthops, from David Ahern.
      
       8) Fix mptcp races between shutdown and recvmsg, from Paolo Abeni.
      
       9) Fix crashes in tipc_disc_rcv(), from Tuong Lien.
      
      10) Fix link speed reporting in iavf driver, from Brett Creeley.
      
      11) When a channel is used for XSK and then reused again later for XSK,
          we forget to clear out the relevant data structures in mlx5 which
          causes all kinds of problems. Fix from Maxim Mikityanskiy.
      
      12) Fix memory leak in genetlink, from Cong Wang.
      
      13) Disallow sockmap attachments to UDP sockets, it simply won't work.
          From Lorenz Bauer.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits)
        net: ethernet: ti: ale: fix allmulti for nu type ale
        net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init
        net: atm: Remove the error message according to the atomic context
        bpf: Undo internal BPF_PROBE_MEM in BPF insns dump
        libbpf: Support pre-initializing .bss global variables
        tools/bpftool: Fix skeleton codegen
        bpf: Fix memlock accounting for sock_hash
        bpf: sockmap: Don't attach programs to UDP sockets
        bpf: tcp: Recv() should return 0 when the peer socket is closed
        ibmvnic: Flush existing work items before device removal
        genetlink: clean up family attributes allocations
        net: ipa: header pad field only valid for AP->modem endpoint
        net: ipa: program upper nibbles of sequencer type
        net: ipa: fix modem LAN RX endpoint id
        net: ipa: program metadata mask differently
        ionic: add pcie_print_link_status
        rxrpc: Fix race between incoming ACK parser and retransmitter
        net/mlx5: E-Switch, Fix some error pointer dereferences
        net/mlx5: Don't fail driver on failure to create debugfs
        net/mlx5e: CT: Fix ipv6 nat header rewrite actions
        ...
      96144c58
    • David Sterba's avatar
      Revert "btrfs: switch to iomap_dio_rw() for dio" · 55e20bd1
      David Sterba authored
      This reverts commit a43a67a2
      
      .
      
      This patch reverts the main part of switching direct io implementation
      to iomap infrastructure. There's a problem in invalidate page that
      couldn't be solved as regression in this development cycle.
      
      The problem occurs when buffered and direct io are mixed, and the ranges
      overlap. Although this is not recommended, filesystems implement
      measures or fallbacks to make it somehow work. In this case, fallback to
      buffered IO would be an option for btrfs (this already happens when
      direct io is done on compressed data), but the change would be needed in
      the iomap code, bringing new semantics to other filesystems.
      
      Another problem arises when again the buffered and direct ios are mixed,
      invalidation fails, then -EIO is set on the mapping and fsync will fail,
      though there's no real error.
      
      There have been discussions how to fix that, but revert seems to be the
      least intrusive option.
      
      Link: https://lore.kernel.org/linux-btrfs/20200528192103.xm45qoxqmkw7i5yl@fiona/
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      55e20bd1
    • Grygorii Strashko's avatar
      net: ethernet: ti: ale: fix allmulti for nu type ale · bc139119
      Grygorii Strashko authored
      On AM65xx MCU CPSW2G NUSS and 66AK2E/L NUSS allmulti setting does not allow
      unregistered mcast packets to pass.
      
      This happens, because ALE VLAN entries on these SoCs do not contain port
      masks for reg/unreg mcast packets, but instead store indexes of
      ALE_VLAN_MASK_MUXx_REG registers which intended for store port masks for
      reg/unreg mcast packets.
      This path was missed by commit 9d1f6447 ("net: ethernet: ti: ale: fix
      seeing unreg mcast packets with promisc and allmulti disabled").
      
      Hence, fix it by taking into account ALE type in cpsw_ale_set_allmulti().
      
      Fixes: 9d1f6447
      
       ("net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc139119
    • Grygorii Strashko's avatar
      net: ethernet: ti: am65-cpsw-nuss: fix ale parameters init · 2074f9ea
      Grygorii Strashko authored
      The ALE parameters structure is created on stack, so it has to be reset
      before passing to cpsw_ale_create() to avoid garbage values.
      
      Fixes: 93a76530
      
       ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2074f9ea
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · fa7566a0
      David S. Miller authored
      
      
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2020-06-12
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 26 non-merge commits during the last 10 day(s) which contain
      a total of 27 files changed, 348 insertions(+), 93 deletions(-).
      
      The main changes are:
      
      1) sock_hash accounting fix, from Andrey.
      
      2) libbpf fix and probe_mem sanitizing, from Andrii.
      
      3) sock_hash fixes, from Jakub.
      
      4) devmap_val fix, from Jesper.
      
      5) load_bytes_relative fix, from YiFei.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa7566a0
    • Liao Pingfang's avatar
      net: atm: Remove the error message according to the atomic context · bf97bac9
      Liao Pingfang authored
      
      
      Looking into the context (atomic!) and the error message should be dropped.
      
      Signed-off-by: default avatarLiao Pingfang <liao.pingfang@zte.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf97bac9
    • Linus Torvalds's avatar
      Merge tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · f82e7b57
      Linus Torvalds authored
      Pull more cifs updates from Steve French:
       "12 cifs/smb3 fixes, 2 for stable.
      
         - add support for idsfromsid on create and chgrp/chown allowing
           ability to save owner information more naturally for some workloads
      
         - improve query info (getattr) when SMB3.1.1 posix extensions are
           negotiated by using new query info level"
      
      * tag '5.8-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: Add debug message for new file creation with idsfromsid mount option
        cifs: fix chown and chgrp when idsfromsid mount option enabled
        smb3: allow uid and gid owners to be set on create with idsfromsid mount option
        smb311: Add tracepoints for new compound posix query info
        smb311: add support for using info level for posix extensions query
        smb311: Add support for lookup with posix extensions query info
        smb311: Add support for SMB311 query info (non-compounded)
        SMB311: Add support for query info using posix extensions (level 100)
        smb3: add indatalen that can be a non-zero value to calculation of credit charge in smb2 ioctl
        smb3: fix typo in mount options displayed in /proc/mounts
        cifs: Add get_security_type_str function to return sec type.
        smb3: extend fscache mount volume coherency check
      f82e7b57