Revision d81916910f7498fe7a768697e0101d488f9fe665 authored by Yang Yingliang on 29 October 2022, 08:29:31 UTC, committed by Huacai Chen on 29 October 2022, 08:29:31 UTC
Currently the return value of 'sub_driver->init' is not checked. If
sparse_keymap_setup() called in the init function fails, 'generic_
inputdev' is freed, then it will lead a UAF when using it in generic_
acpi_laptop_init(). Fix it by checking the return value and setting
generic_inputdev to NULL after free, so as to avoid double free it.

The error code in generic_subdriver_init() is always negative, so the
return of generic_subdriver_init() can be simplified.

Fixes: 6246ed09111f ("LoongArch: Add ACPI-based generic laptop driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent fbe605a
History
File Mode Size
ac97
ali5451
asihpi
au88x0
aw2
ca0106
cs46xx
cs5535audio
ctxfi
echoaudio
emu10k1
hda
ice1712
korg1212
lola
lx6464es
mixart
nm256
oxygen
pcxhr
riptide
rme9652
trident
vx222
ymfpci
Kconfig -rw-r--r-- 25.4 KB
Makefile -rw-r--r-- 2.2 KB
ad1889.c -rw-r--r-- 23.1 KB
ad1889.h -rw-r--r-- 7.9 KB
ak4531_codec.c -rw-r--r-- 16.3 KB
als300.c -rw-r--r-- 19.7 KB
als4000.c -rw-r--r-- 29.2 KB
atiixp.c -rw-r--r-- 43.2 KB
atiixp_modem.c -rw-r--r-- 33.3 KB
azt3328.c -rw-r--r-- 80.0 KB
azt3328.h -rw-r--r-- 15.5 KB
bt87x.c -rw-r--r-- 27.8 KB
cmipci.c -rw-r--r-- 99.0 KB
cs4281.c -rw-r--r-- 61.6 KB
cs5530.c -rw-r--r-- 5.5 KB
ens1370.c -rw-r--r-- 75.6 KB
ens1371.c -rw-r--r-- 38 bytes
es1938.c -rw-r--r-- 53.2 KB
es1968.c -rw-r--r-- 76.7 KB
fm801.c -rw-r--r-- 40.2 KB
intel8x0.c -rw-r--r-- 87.6 KB
intel8x0m.c -rw-r--r-- 34.6 KB
maestro3.c -rw-r--r-- 79.9 KB
rme32.c -rw-r--r-- 55.7 KB
rme96.c -rw-r--r-- 69.3 KB
sis7019.c -rw-r--r-- 37.8 KB
sis7019.h -rw-r--r-- 12.7 KB
sonicvibes.c -rw-r--r-- 48.6 KB
via82xx.c -rw-r--r-- 74.9 KB
via82xx_modem.c -rw-r--r-- 32.2 KB

back to top