1. 18 May, 2018 3 commits
    • Gustavo A. R. Silva's avatar
      drm/nouveau/secboot: remove VLA usage · 7bf5b70b
      Gustavo A. R. Silva authored
      In preparation to enabling -Wvla, remove VLA. In this particular
      case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local
      variable cmdline_size. Also, remove cmdline_size as it is not
      actually useful anymore.
      
      The use of stack Variable Length Arrays needs to be avoided, as they
      can be a vector for stack exhaustion, which can be both a runtime bug
      or a security flaw. Also, in general, as code evolves it is easy to
      lose track of how big a VLA can get. Thus, we can end up having runtime
      failures that are hard to debug.
      
      Also, fixed as part of the directive to remove all VLAs from
      the kernel: https://lkml.org/lkml/2018/3/7/621Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      7bf5b70b
    • Arnd Bergmann's avatar
      drm/nouveau: nouveau: use larger buffer in nvif_vmm_map · 9dfbd731
      Arnd Bergmann authored
      gcc points out a buffer that is clearly too small to be used
      in a meaningful way, as the 'sizeof(*args) + argc > sizeof(stack)'
      will always fail:
      
      In function 'memcpy',
          inlined from 'nvif_vmm_map' at drivers/gpu/drm/nouveau/nvif/vmm.c:55:2:
      include/linux/string.h:353:9: error: '__builtin_memcpy' offset 40 is out of the bounds [0, 16] of object 'stack' with type 'u8[16]' {aka 'unsigned char[16]'} [-Werror=array-bounds]
        return __builtin_memcpy(p, q, size);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/nouveau/nvif/vmm.c: In function 'nvif_vmm_map':
      drivers/gpu/drm/nouveau/nvif/vmm.c:40:5: note: 'stack' declared here
      
      This makes the buffer large enough so it should serve the purpose
      that the author presumably had in mind. Alternatively we could
      just get rid of it completely and simplify the code at the cost
      of always doing the kmalloc (as we do in the current version).
      
      Fixes: 920d2b5e ("drm/nouveau/mmu: define user interfaces to mmu vmm opertaions")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      9dfbd731
    • Dave Airlie's avatar
      Merge drm-fixes-for-v4.17-rc6-urgent into drm-next · 1fafef9d
      Dave Airlie authored
      Need to backmerge some nouveau fixes to reduce
      the nouveau -next conflicts a lot.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      1fafef9d
  2. 17 May, 2018 3 commits
  3. 15 May, 2018 34 commits