Re: [PATCH v6] drm/i915: Avoid writing relocs with addresses in non-canonical form

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 22, 2015 at 01:37:10PM +0100, Michał Winiarski wrote:
> +		/* Offset can be used as input (EXEC_OBJECT_PINNED), since
> +		 * userspace has to use canonical format, we need to reject all
> +		 * non-canonical addresses.
> +		 */
> +		if (exec[i].offset != gen8_canonical_addr(exec[i].offset))
> +			return -EINVAL;
> +
> +		/* On the other hand, from drm_mm perspective address space is
> +		 * continuous, so we're converting to non-canonical form
> +		 */
> +		exec[i].offset &= (1ULL << 48) - 1;

I'm still dubious about making this ABI change backwards. Only
EXEC_OBJECT_PINNED uses this as an input and in the past we have stuffed
bad values in here to force relocations etc.

Also note that EXEC_OBJECT_PINNED doesn't do if (exec[i].offset & 4095)
return -EINVAL;

I would address both at once.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux