1. 18 5月, 2018 3 次提交
    • B
      drm/nouveau/core: define FAULT subdev · 1ce46689
      Ben Skeggs 提交于
      This will be responsible for the handling of MMU fault buffers on GPUs
      that support them.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      1ce46689
    • G
      drm/nouveau/secboot: remove VLA usage · 7bf5b70b
      Gustavo A. R. Silva 提交于
      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: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      7bf5b70b
    • A
      drm/nouveau: nouveau: use larger buffer in nvif_vmm_map · 9dfbd731
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      9dfbd731
  2. 17 5月, 2018 3 次提交
  3. 16 5月, 2018 34 次提交