Commit cc8d5b2
LoongArch: KVM: Check validity of "num_cpu" from user space
The maximum supported cpu number is EIOINTC_ROUTE_MAX_VCPUS about
irqchip EIOINTC, here add validation about cpu number to avoid array
pointer overflow.
Cc: stable@vger.kernel.org
Fixes: 1ad7efa ("LoongArch: KVM: Add EIOINTC user mode read and write functions")
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>1 parent 45515c6 commit cc8d5b2
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
808 | | - | |
| 808 | + | |
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
| 816 | + | |
817 | 817 | | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
818 | 824 | | |
819 | 825 | | |
820 | 826 | | |
| |||
842 | 848 | | |
843 | 849 | | |
844 | 850 | | |
845 | | - | |
| 851 | + | |
846 | 852 | | |
847 | 853 | | |
848 | 854 | | |
849 | 855 | | |
850 | 856 | | |
851 | 857 | | |
852 | 858 | | |
853 | | - | |
| 859 | + | |
854 | 860 | | |
855 | 861 | | |
856 | 862 | | |
| |||
875 | 881 | | |
876 | 882 | | |
877 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
878 | 887 | | |
879 | | - | |
| 888 | + | |
880 | 889 | | |
881 | 890 | | |
882 | 891 | | |
| |||
0 commit comments