linux-stable/drivers/gpu/drm/etnaviv
Lucas Stach 6dfa2fab8d drm/etnaviv: limit submit sizes
Currently we allow rediculous amounts of kernel memory being allocated
via the etnaviv GEM_SUBMIT ioctl, which is a pretty easy DoS vector. Put
some reasonable limits in to fix this.

The commandstream size is limited to 64KB, which was already a soft limit
on older kernels after which the kernel only took submits on a best effort
base, so there is no userspace that tries to submit commandstreams larger
than this. Even if the whole commandstream is a single incrementing address
load, the size limit also limits the number of potential relocs and
referenced buffers to slightly under 64K, so use the same limit for those
arguments. The performance monitoring infrastructure currently supports
less than 50 performance counter signals, so limiting them to 128 on a
single submit seems like a reasonably future-proof number for now. This
number can be bumped if needed without breaking the interface.

Cc: stable@vger.kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2021-12-20 21:51:00 +01:00
..
cmdstream.xml.h
common.xml.h
etnaviv_buffer.c drm/etnaviv: return context from etnaviv_iommu_context_get 2021-09-16 10:34:59 +02:00
etnaviv_cmd_parser.c
etnaviv_cmdbuf.c drm/etnaviv: implement softpin 2019-08-15 12:07:47 +02:00
etnaviv_cmdbuf.h drm/etnaviv: rework MMU handling 2019-08-15 10:56:45 +02:00
etnaviv_drv.c drm/etnaviv: use a 32 bit mask as coherent DMA mask 2021-12-01 13:27:12 +01:00
etnaviv_drv.h drm/etnaviv: Implement mmap as GEM object function 2021-07-06 18:32:23 +02:00
etnaviv_dump.c drm/etnaviv: dump: fix sparse warnings 2021-01-22 12:38:17 +01:00
etnaviv_dump.h drm/etnaviv: pass mmu pointer to etnaviv_core_dump_mmu 2019-08-15 10:53:31 +02:00
etnaviv_gem.c drm/etnaviv: return context from etnaviv_iommu_context_get 2021-09-16 10:34:59 +02:00
etnaviv_gem.h drm/etnaviv: Replace zero-length array with flexible-array member 2020-03-05 12:15:46 +01:00
etnaviv_gem_prime.c dma-buf: move dma-buf symbols into the DMA_BUF module namespace 2021-10-25 14:53:08 +02:00
etnaviv_gem_submit.c drm/etnaviv: limit submit sizes 2021-12-20 21:51:00 +01:00
etnaviv_gpu.c drm/etnaviv: constify static struct cooling_ops 2021-12-01 13:27:51 +01:00
etnaviv_gpu.h drm/etnaviv: stop abusing mmu_context as FE running marker 2021-09-16 10:35:15 +02:00
etnaviv_hwdb.c drm/etnaviv: add HWDB entry for GC7000 r6202 2021-07-06 18:31:26 +02:00
etnaviv_iommu.c drm/etnaviv: reference MMU context when setting up hardware state 2021-09-16 10:35:33 +02:00
etnaviv_iommu_v2.c drm/etnaviv: reference MMU context when setting up hardware state 2021-09-16 10:35:33 +02:00
etnaviv_mmu.c drm/etnaviv: add missing MMU context put when reaping MMU mapping 2021-09-16 10:35:37 +02:00
etnaviv_mmu.h drm/etnaviv: return context from etnaviv_iommu_context_get 2021-09-16 10:34:59 +02:00
etnaviv_perfmon.c drm/etnaviv: add pipe_select(..) helper 2020-09-25 12:02:58 +02:00
etnaviv_perfmon.h
etnaviv_sched.c drm/sched: drop entity parameter from drm_sched_push_job 2021-08-30 10:54:45 +02:00
etnaviv_sched.h
Kconfig
Makefile
state.xml.h
state_3d.xml.h
state_blt.xml.h drm/etnaviv: fix TS cache flushing on GPUs with BLT engine 2020-03-20 18:40:44 +01:00
state_hi.xml.h drm/etnaviv: Update idle bits 2020-03-03 10:58:57 +01:00