From: Dave Jones Date: Mon, 19 Oct 2009 23:55:13 +0000 (-0400) Subject: gdth: Prevent negative offsets in ioctl CVE-2009-3080 X-Git-Tag: v2.6.31.7~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=174388981606378894ab74cae9467d5bbf0e5830;p=thirdparty%2Fkernel%2Fstable.git gdth: Prevent negative offsets in ioctl CVE-2009-3080 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 Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 185e6bc4dd400..9e8fce0f0c1b3 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -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; }