]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gdth: Prevent negative offsets in ioctl CVE-2009-3080
authorDave Jones <davej@redhat.com>
Mon, 19 Oct 2009 23:55:13 +0000 (19:55 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:20:55 +0000 (10:20 -0800)
commit 690e744869f3262855b83b4fb59199cf142765b0 upstream.

A negative offset could be used to index before the event buffer and
lead to a security breach.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/gdth.c

index 185e6bc4dd40076519dea524d9687fa8cc0f51f5..9e8fce0f0c1b3f1022b5658a2ad503fcc810abf6 100644 (file)
@@ -2900,7 +2900,7 @@ static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr)
         eindex = handle;
     estr->event_source = 0;
 
-    if (eindex >= MAX_EVENTS) {
+    if (eindex < 0 || eindex >= MAX_EVENTS) {
         spin_unlock_irqrestore(&ha->smp_lock, flags);
         return eindex;
     }