drm/nouveau: Validate channel indices passed from userspace.
authorMichel Hermier <hermier@frugalware.org>
Sat, 25 Dec 2010 15:58:56 +0000 (16:58 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 27 Dec 2010 00:41:01 +0000 (10:41 +1000)
commit8e91182bbdb8591be4835907d825a5b9a80495a9
treea1154af0d994252622da3d48fcdcb1b8de775d03
parentc42988012ad9c1807b7c7a5ff855cd630094989b
drm/nouveau: Validate channel indices passed from userspace.

When hacking the libdrm for improvements, I triggered a kernel crash
related to the fact that the NOUVEAU_NOTIFIEROBJ_ALLOC ioctl calls
nouveau_channel_get with an unchecked channel index.
The patch ensures that the channel index is an unsigned and validates
its value in nouveau_channel_get.

Signed-off-by: Michel Hermier <hermier@frugalware.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_channel.c