diff options
author | NeilBrown <neilb@suse.de> | 2023-03-06 01:36:25 +0300 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2023-03-13 22:50:54 +0300 |
commit | 3bc57292278a0b6ac4656cad94c14f2453344b57 (patch) | |
tree | d3e5ec05fe586be34665ff6296710d7ec2d27388 /tools/perf/scripts/python/task-analyzer.py | |
parent | 3e453522593d74a87cf68a38e14aa36ebca1dbcd (diff) | |
download | linux-3bc57292278a0b6ac4656cad94c14f2453344b57.tar.xz |
md: avoid signed overflow in slot_store()
slot_store() uses kstrtouint() to get a slot number, but stores the
result in an "int" variable (by casting a pointer).
This can result in a negative slot number if the unsigned int value is
very large.
A negative number means that the slot is empty, but setting a negative
slot number this way will not remove the device from the array. I don't
think this is a serious problem, but it could cause confusion and it is
best to fix it.
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions