]> www.infradead.org Git - users/jedix/linux-maple.git/commit
[mpt2sas] fix NULL pointer at ioc->pfacts
authorNagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Mon, 7 May 2012 20:40:00 +0000 (13:40 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:32:37 +0000 (17:32 -0700)
commit6fe016fa8e9500f0db099d0db8657ab990651594
tree490ffb95ea3624ba9139704828fbbf9d6b437dab
parent24b85a69af103b12c7896665e5e91faaa41a1b11
[mpt2sas] fix NULL pointer at ioc->pfacts

Orabug: 14040678
The ioc->pfacts member in the IOC structure is getting set to zero
following a call to _base_get_ioc_facts due to the memset in that routine.
So if the ioc->pfacts was read after a host reset, there would be a NULL
pointer dereference. The routine _base_get_ioc_facts is called from context
of host reset.  The problem in _base_get_ioc_facts  is the size of
Mpi2IOCFactsReply is 64, whereas the sizeof "struct mpt2sas_facts" is 60,
so there is a four byte overflow resulting from the memset.

Also, there is memset in _base_get_port_facts using the incorrect structure,
it should be "struct mpt2sas_port_facts" instead of Mpi2PortFactsReply.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
drivers/scsi/mpt2sas/mpt2sas_base.c