Re: [patch] [SCSI] atp870u: 64 bit bug in probe()
On 07/29/2015 11:36 PM, Dan Carpenter wrote: On 64 bit CPUs there is a memory corruption bug on probe(). It should be a u32 pointer instead of an unsigned long pointer or we write past the end of the setupdata[] array. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Someone reported in 2003 that probe has a NULL deref so maybe it's related to this memory corruption? https://bugzilla.kernel.org/show_bug.cgi?id=1118 If only we had applied this patch when I originally sent it two years ago, then it would only be 10 years too late instead of 12! :P Reviewed-by: Hannes Reinecke h...@suse.com Cheers, Hannes -- Dr. Hannes ReineckezSeries Storage h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] [SCSI] atp870u: 64 bit bug in probe()
On 64 bit CPUs there is a memory corruption bug on probe(). It should be a u32 pointer instead of an unsigned long pointer or we write past the end of the setupdata[] array. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Someone reported in 2003 that probe has a NULL deref so maybe it's related to this memory corruption? https://bugzilla.kernel.org/show_bug.cgi?id=1118 If only we had applied this patch when I originally sent it two years ago, then it would only be 10 years too late instead of 12! :P diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 05301bc..62acabd 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -2791,11 +2791,11 @@ next_fblk_885: p-global_map[m]= 0; for (k=0; k 4; k++) { outw(n++,base_io + 0x3c); - ((unsigned long *)setupdata[m][0])[k]=inl(base_io + 0x38); + ((u32 *)setupdata[m][0])[k]=inl(base_io + 0x38); } for (k=0; k 4; k++) { outw(n++,base_io + 0x3c); - ((unsigned long *)p-sp[m][0])[k]=inl(base_io + 0x38); + ((u32 *)p-sp[m][0])[k]=inl(base_io + 0x38); } n += 8; } -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] [SCSI] atp870u: 64 bit bug in probe()
On 64 bit CPUs there is a memory corruption bug on probe(). It should be setting 32 bits of data on both 32 and 64 bit. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Static checker stuff. I can't test this. diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 15a629d..3edbf30 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -2791,11 +2791,11 @@ next_fblk_885: p-global_map[m]= 0; for (k=0; k 4; k++) { outw(n++,base_io + 0x3c); - ((unsigned long *)setupdata[m][0])[k]=inl(base_io + 0x38); + ((u32 *)setupdata[m][0])[k]=inl(base_io + 0x38); } for (k=0; k 4; k++) { outw(n++,base_io + 0x3c); - ((unsigned long *)p-sp[m][0])[k]=inl(base_io + 0x38); + ((u32 *)p-sp[m][0])[k]=inl(base_io + 0x38); } n += 8; } -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html