• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revision5dceef59f2919d7396853e4264636e3bd55f85e7 (tree)
Zeit2006-03-12 06:49:33
AutorMarin Mitov <mitov@issp...>
CommiterMarcelo Tosatti

Log Message

[PATCH] DRM: drm_stub_open() range checking

This patch corrects a bug in drm driver by forcing
its minor number in the limits of the allocated
resources: DRM(stub_list)[DRM_STUB_MAXCARDS]

0<= minor < DRM_STUB_MAXCARDS.

Manifestation: Xorg-6.9.0 SIGSEGFAULTs when the
loading of dri module is enabled (direct rendering)
Xorg-6.9.0 (and evidently not the previous versions)
has defined DRM_MAX_MINOR as 255 (and Xorg-6.9.0
tries to open all of them) while in the kernel:
DRM_STUB_MAXCARDS is defined as 16.

Ändern Zusammenfassung

Diff

--- a/drivers/char/drm/drm_stub.h
+++ b/drivers/char/drm/drm_stub.h
@@ -52,6 +52,7 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp)
5252 int err = -ENODEV;
5353 struct file_operations *old_fops;
5454
55+ if (minor < 0 || minor >=DRM_STUB_MAXCARDS) return -ENODEV;
5556 if (!DRM(stub_list) || !DRM(stub_list)[minor].fops) return -ENODEV;
5657 old_fops = filp->f_op;
5758 filp->f_op = fops_get(DRM(stub_list)[minor].fops);
Show on old repository browser