linux/drivers/infiniband/hw/nes
Roland Dreier 51af33e8e4 RDMA/nes: Fix possible array overrun
In nes_create_qp(), the test

	if (nesqp->mmap_sq_db_index > NES_MAX_USER_WQ_REGIONS) {

is used to error out if the db_index is too large; however, if the
test doesn't trigger, then the index is used as

	nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = nesqp;

and mmap_nesqp is declared as

	struct nes_qp      *mmap_nesqp[NES_MAX_USER_WQ_REGIONS];

which leads to an array overrun if the index is exactly equal to
NES_MAX_USER_WQ_REGIONS.  Fix this by bailing out if the index is
greater than or equal to NES_MAX_USER_WQ_REGIONS.

This was spotted by the Coverity checker (CID 2162).

Acked-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-18 10:33:59 -08:00
..
Kconfig RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
Makefile RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_cm.c RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_cm.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_context.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_hw.c RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_hw.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_nic.c RDMA/nes: Fix VLAN support 2008-02-16 21:16:33 -08:00
nes_user.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_utils.c RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes_verbs.c RDMA/nes: Fix possible array overrun 2008-02-18 10:33:59 -08:00
nes_verbs.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes.c RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
nes.h RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00