[PATCH v3 10/19] nvme: Move NVMe and Block PR types to an array

Keith Busch kbusch at kernel.org
Thu Oct 27 10:16:25 PDT 2022


On Thu, Oct 27, 2022 at 12:13:06PM -0500, michael.christie at oracle.com wrote:
> Oh wait there was also a
> 
> 3. The pr_types come from userspace so if it passes us 10
> and we just do:
> 
> types[pr_type]
> 
> then we would crash due an out of bounds error.
> 
> Similarly I thought there could be a bad target that does the
> same thing.

Well, you'd of course have to check the boundaries before accessing if
you were to implement this scheme. :)

But considering this isn't a performance path, perhaps these kinds of
optimizations are not worth it.



More information about the Linux-nvme mailing list