mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: check capability for reschedule runlist submit flag
NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST is only used by realtime priority EGL context, which checks for CAP_SYS_NICE during context creation in userspace, so it wasn't secure against unprivileged program spoofing submit ioctl with this flag to stall GPU progress of others. This flag does increase duration of submit by approx 16us, mostly due to register accesses and PMU FIFO mutex. Bug 1989493 Bug 1854791 Bug 1968813 Change-Id: I086b1d14f286abf8bd2d2dfae5945974b7fe6d1f Reviewed-on: https://git-master.nvidia.com/r/#/c/1558644 Signed-off-by: David Li <davli@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1558683 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
42d90e17dd
commit
c37fdaaa02
@@ -3857,6 +3857,11 @@ static int gk20a_ioctl_channel_submit_gpfifo(
|
|||||||
#endif
|
#endif
|
||||||
if (ch->has_timedout)
|
if (ch->has_timedout)
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
|
|
||||||
|
if ((NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST & args->flags) &&
|
||||||
|
!capable(CAP_SYS_NICE))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
ret = gk20a_submit_channel_gpfifo(ch, NULL, args, args->num_entries,
|
ret = gk20a_submit_channel_gpfifo(ch, NULL, args, args->num_entries,
|
||||||
args->flags, &args->fence,
|
args->flags, &args->fence,
|
||||||
&fence_out, false, profile);
|
&fence_out, false, profile);
|
||||||
|
|||||||
Reference in New Issue
Block a user