Commit e402608
committed
platform/x86: panasonic-laptop: Fix SINF array out of bounds accesses
JIRA: https://issues.redhat.com/browse/RHEL-55365
commit f52e98d
Author: Hans de Goede <hdegoede@redhat.com>
Date: Mon Sep 9 13:32:25 2024 +0200
platform/x86: panasonic-laptop: Fix SINF array out of bounds accesses
The panasonic laptop code in various places uses the SINF array with index
values of 0 - SINF_CUR_BRIGHT(0x0d) without checking that the SINF array
is big enough.
Not all panasonic laptops have this many SINF array entries, for example
the Toughbook CF-18 model only has 10 SINF array entries. So it only
supports the AC+DC brightness entries and mute.
Check that the SINF array has a minimum size which covers all AC+DC
brightness entries and refuse to load if the SINF array is smaller.
For higher SINF indexes hide the sysfs attributes when the SINF array
does not contain an entry for that attribute, avoiding show()/store()
accessing the array out of bounds and add bounds checking to the probe()
and resume() code accessing these.
Fixes: e424fb8 ("panasonic-laptop: avoid overflow in acpi_pcc_hotkey_add()")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240909113227.254470-1-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: David Arcari <darcari@redhat.com>1 parent c22680a commit e402608
1 file changed
+39
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
776 | 794 | | |
777 | 795 | | |
778 | 796 | | |
| |||
787 | 805 | | |
788 | 806 | | |
789 | 807 | | |
790 | | - | |
791 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
792 | 811 | | |
793 | 812 | | |
794 | 813 | | |
| |||
941 | 960 | | |
942 | 961 | | |
943 | 962 | | |
944 | | - | |
945 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
946 | 967 | | |
947 | 968 | | |
948 | 969 | | |
949 | | - | |
| 970 | + | |
| 971 | + | |
950 | 972 | | |
951 | 973 | | |
952 | 974 | | |
| |||
963 | 985 | | |
964 | 986 | | |
965 | 987 | | |
966 | | - | |
967 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
968 | 994 | | |
969 | 995 | | |
970 | 996 | | |
| |||
1020 | 1046 | | |
1021 | 1047 | | |
1022 | 1048 | | |
1023 | | - | |
1024 | | - | |
1025 | 1049 | | |
1026 | 1050 | | |
1027 | | - | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1028 | 1057 | | |
1029 | 1058 | | |
1030 | 1059 | | |
| |||
0 commit comments