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
Raw File
head-object-list.txt
# Head objects
#
# The objects listed here are placed at the head of vmlinux. A typical use-case
# is an object that contains the entry point. This is kept for compatibility
# with head-y, which Kbuild used to support.
#
# A counter approach is to control the section placement by the linker script.
# The code marked as __HEAD goes into the ".head.text" section, which is placed
# before the normal ".text" section.
#
# If you can achieve the correct code ordering by linker script, please delete
# the entry from this file.
#
arch/alpha/kernel/head.o
arch/arc/kernel/head.o
arch/arm/kernel/head-nommu.o
arch/arm/kernel/head.o
arch/arm64/kernel/head.o
arch/csky/kernel/head.o
arch/hexagon/kernel/head.o
arch/ia64/kernel/head.o
arch/loongarch/kernel/head.o
arch/m68k/68000/head.o
arch/m68k/coldfire/head.o
arch/m68k/kernel/head.o
arch/m68k/kernel/sun3-head.o
arch/microblaze/kernel/head.o
arch/mips/kernel/head.o
arch/nios2/kernel/head.o
arch/openrisc/kernel/head.o
arch/parisc/kernel/head.o
arch/powerpc/kernel/head_40x.o
arch/powerpc/kernel/head_44x.o
arch/powerpc/kernel/head_64.o
arch/powerpc/kernel/head_8xx.o
arch/powerpc/kernel/head_85xx.o
arch/powerpc/kernel/head_book3s_32.o
arch/powerpc/kernel/entry_64.o
arch/powerpc/kernel/fpu.o
arch/powerpc/kernel/vector.o
arch/powerpc/kernel/prom_init.o
arch/riscv/kernel/head.o
arch/s390/kernel/head64.o
arch/sh/kernel/head_32.o
arch/sparc/kernel/head_32.o
arch/sparc/kernel/head_64.o
arch/x86/kernel/head_32.o
arch/x86/kernel/head_64.o
arch/x86/kernel/head32.o
arch/x86/kernel/head64.o
arch/x86/kernel/ebda.o
arch/x86/kernel/platform-quirks.o
arch/xtensa/kernel/head.o
back to top