+9
−3
Loading
stable inclusion from stable-v5.10.227 commit da964de4c18199e14b961b5b2e5e6570552a313c category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRCN CVE: CVE-2024-49955 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=da964de4c18199e14b961b5b2e5e6570552a313c -------------------------------- [ Upstream commit 76959aff14a0012ad6b984ec7686d163deccdc16 ] When a battery hook returns an error when adding a new battery, then the battery hook is automatically unregistered. However the battery hook provider cannot know that, so it will later call battery_hook_unregister() on the already unregistered battery hook, resulting in a crash. Fix this by using the list head to mark already unregistered battery hooks as already being unregistered so that they can be ignored by battery_hook_unregister(). Fixes: fa93854f ("battery: Add the battery hooking API") Signed-off-by:Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/20241001212835.341788-3-W_Armin@gmx.de Cc: All applicable <stable@vger.kernel.org> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
liwei <liwei728@huawei.com>