alistair23-linux/drivers/s390/net
Jean Delvare 048a7f8b4e s390: qeth: Fix potential array overrun in cmd/rc lookup
Functions qeth_get_ipa_msg and qeth_get_ipa_cmd_name are modifying
the last member of global arrays without any locking that I can see.
If two instances of either function are running at the same time,
it could cause a race ultimately leading to an array overrun (the
contents of the last entry of the array is the only guarantee that
the loop will ever stop).

Performing the lookups without modifying the arrays is admittedly
slower (two comparisons per iteration instead of one) but these
are operations which are rare (should only be needed in error
cases or when debugging, not during successful operation) and it
seems still less costly than introducing a mutex to protect the
arrays in question.

As a side bonus, it allows us to declare both arrays as const data.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Julian Wiedmann <jwi@linux.ibm.com>
Cc: Ursula Braun <ubraun@linux.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-28 10:27:26 -07:00
..
ctcm_dbug.c
ctcm_dbug.h
ctcm_fsms.c
ctcm_fsms.h
ctcm_main.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
ctcm_main.h
ctcm_mpc.c
ctcm_mpc.h
ctcm_sysfs.c
fsm.c
fsm.h
ism.h s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
ism_drv.c s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
Kconfig s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
lcs.c s390/net: set HW port number in netdevice 2018-04-27 13:38:47 -04:00
lcs.h
Makefile s390/ism: add device driver for internal shared memory 2018-06-30 20:42:26 +09:00
netiucv.c
qeth_core.h s390/qeth: don't restrict qeth_card to DMA memory 2018-08-09 14:02:50 -07:00
qeth_core_main.c s390: qeth: Fix potential array overrun in cmd/rc lookup 2018-09-28 10:27:26 -07:00
qeth_core_mpc.c s390: qeth: Fix potential array overrun in cmd/rc lookup 2018-09-28 10:27:26 -07:00
qeth_core_mpc.h s390: qeth: Fix potential array overrun in cmd/rc lookup 2018-09-28 10:27:26 -07:00
qeth_core_sys.c s390/qeth: don't cache HW port number 2018-07-21 10:12:30 -07:00
qeth_l2.h s390/qeth: clean up exported symbols 2018-07-12 16:42:39 -07:00
qeth_l2_main.c s390/qeth: don't dump past end of unknown HW header 2018-09-12 13:12:51 -07:00
qeth_l2_sys.c
qeth_l3.h
qeth_l3_main.c s390/qeth: don't dump past end of unknown HW header 2018-09-12 13:12:51 -07:00
qeth_l3_sys.c s390/qeth: allocate netdevice early 2018-07-21 10:12:29 -07:00
smsgiucv.c
smsgiucv.h
smsgiucv_app.c