Input: add bounds checking to input_set_capability()
stable inclusion from stable-v5.10.118 commit d5e88c2d76efa9d7bb7ceffaec60fe6c76c748d7 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5L686 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d5e88c2d76efa9d7bb7ceffaec60fe6c76c748d7 -------------------------------- [ Upstream commit 409353cb ] Update input_set_capability() to prevent kernel panic in case the event code exceeds the bitmap for the given event type. Suggested-by: NTomasz Moń <tomasz.mon@camlingroup.com> Signed-off-by: NJeff LaBundy <jeff@labundy.com> Reviewed-by: NTomasz Moń <tomasz.mon@camlingroup.com> Link: https://lore.kernel.org/r/20220320032537.545250-1-jeff@labundy.comSigned-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录