Loading
thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR
mainline inclusion from mainline-v6.0-rc3 commit 7931e280 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9LKDZ CVE: CVE-2022-48703 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7931e28098a4 -------------------------------- In some case, the GDDV returns a package with a buffer which has zero length. It causes that kmemdup() returns ZERO_SIZE_PTR (0x10). Then the data_vault_read() got NULL point dereference problem when accessing the 0x10 value in data_vault. [ 71.024560] BUG: kernel NULL pointer dereference, address: 0000000000000010 This patch uses ZERO_OR_NULL_PTR() for checking ZERO_SIZE_PTR or NULL value in data_vault. Signed-off-by:"Lee, Chun-Yi" <jlee@suse.com> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Conflicts: drivers/thermal/intel/int340x_thermal/int3400_thermal.c [The conflicts were caused by not merged 9e5d3d6b ("thermal: int340x: Consolidate freeing of acpi_buffer pointer")] Signed-off-by:
Pu Lehui <pulehui@huawei.com>