1
0
Fork 0
alistair23-linux/tools
Frank Asseg 6c59f64b7e tools/thermal: tmon: fix for segfault
Fixes a segfault occurring when e.g. <TAB> is pressed multiple times in the
ncurses tmon application. The segfault is caused by incrementing
cur_thermal_record in the main function without checking if it's value reached
NR_THERMAL_RECORD immediately. Since the boundary check only occurred in
update_thermal_data a race condition existed, which lead to an attempted read
beyond the last element of the trec array.

The fix was implemented by moving the cur_thermal_record incrementation to the
update_thermal_data function using a temporary variable on which the boundary
condition is checked before updating cur_thread_record, so that the variable is
never incremented beyond the trec array's boundary.

It seems the segfault does not occur on every machine: On a HP EliteBook G4 the
segfault happens, while it does not happen on a Thinkpad T540p.

Signed-off-by: Frank Asseg <frank.asseg@objecthunter.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-27 09:51:23 +02:00
..
accounting License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch tools headers: Sync x86's cpufeatures.h 2018-03-05 12:07:52 -03:00
bpf tools: bpftool: preserve JSON output on errors on batch file parsing 2018-02-15 10:01:05 +01:00
build Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
cgroup tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
hv tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
iio tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
include tools headers: Sync copy of kvm UAPI headers 2018-03-05 11:56:40 -03:00
kvm/kvm_stat tools/kvm_stat: print 'Total' line for multiple events only 2018-02-24 01:43:46 +01:00
laptop tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
leds tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
lib tools/libbpf: Avoid possibly using uninitialized variable 2018-02-20 21:08:20 +01:00
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
objtool objtool: Fix 32-bit build 2018-03-07 07:50:38 +01:00
pci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf perf tools: Fix trigger class trigger_on() 2018-03-06 11:31:14 -03:00
power tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
scripts tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
spi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
testing Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-03-18 12:03:15 -07:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-03-27 09:51:23 +02:00
time
usb tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
virtio virtio, vhost: fixes, cleanups, features 2018-02-08 10:41:00 -08:00
vm tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
wmi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
Makefile platform-drivers-x86 for v4.15-1 2017-11-18 10:26:57 -08:00