1
0
Fork 0
alistair23-linux/drivers/s390
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
..
block libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
char TTY/Serial driver patches for 4.19-rc1 2018-08-18 10:50:41 -07:00
cio s390 cio: Rewrite trace point class s390_class_schib 2018-07-23 13:49:56 +02:00
crypto s390/zcrypt: remove VLA usage from the AP bus 2018-09-12 11:33:37 +02:00
net s390: qeth: Fix potential array overrun in cmd/rc lookup 2018-09-28 10:27:26 -07:00
scsi s390/dasd,zfcp: fix gcc 8 stringop-truncation warnings 2018-07-02 11:24:52 +02:00
virtio virtio/s390: implement PM operations for virtio_ccw 2018-02-14 14:34:09 +02:00
Makefile kbuild: rename built-in.o to built-in.a 2018-03-26 02:01:19 +09:00