From: Dave Jones Date: Mon, 19 Oct 2009 23:55:13 +0000 (-0400) Subject: [SCSI] gdth: Prevent negative offsets in ioctl CVE-2009-3080 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=690e744869f3262855b83b4fb59199cf142765b0;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [SCSI] gdth: Prevent negative offsets in ioctl CVE-2009-3080 A negative offset could be used to index before the event buffer and lead to a security breach. Signed-off-by: Dave Jones Cc: Stable Tree Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 185e6bc4dd40..9e8fce0f0c1b 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; }