linux-stable/tools/power/acpi
Chen Yu 0bc23d8b22 ACPI: tools: pfrut: Check if the input of level and type is in the right numeric range
The user provides arbitrary non-numeic value to level and type,
which could bring unexpected behavior. In this case the expected
behavior would be to throw an error.

 pfrut -h
usage: pfrut [OPTIONS]
code injection:
-l, --load
-s, --stage
-a, --activate
-u, --update [stage and activate]
-q, --query
-d, --revid
update telemetry:
-G, --getloginfo
-T, --type(0:execution, 1:history)
-L, --level(0, 1, 2, 4)
-R, --read
-D, --revid log

 pfrut -T A
 pfrut -G
log_level:0
log_type:0
log_revid:2
max_data_size:65536
chunk1_size:0
chunk2_size:1530
rollover_cnt:0
reset_cnt:17

Fix this by restricting the input to be in the expected range.

Reported-by: Hariganesh Govindarajulu <hariganesh.govindarajulu@intel.com>
Suggested-by: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-03-14 20:38:13 +01:00
..
common ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
man ACPI: tools: Introduce utility for firmware updates/telemetry 2021-12-27 17:12:58 +01:00
os_specific/service_layers ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
tools ACPI: tools: pfrut: Check if the input of level and type is in the right numeric range 2023-03-14 20:38:13 +01:00
.gitignore ACPI: tools: Introduce utility for firmware updates/telemetry 2021-12-27 17:12:58 +01:00
Makefile ACPI: tools: Introduce utility for firmware updates/telemetry 2021-12-27 17:12:58 +01:00
Makefile.config ACPI: tools: Fix compilation when output directory is not present 2021-12-08 15:10:27 +01:00
Makefile.rules ACPI: tools: Introduce utility for firmware updates/telemetry 2021-12-27 17:12:58 +01:00