]> git.baikalelectronics.ru Git - kernel.git/commit
macintosh/adb: fix oob read in do_adb_query() function
authorNing Qiang <sohu0106@126.com>
Wed, 13 Jul 2022 15:37:34 +0000 (23:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Aug 2022 11:07:54 +0000 (13:07 +0200)
commitac9494d14ba1c043cb54a06427c84aafe8b84e30
treed2f75120d7082f999f53192069d181e90a49d1fa
parentdae5b4d636c33f4fc6fc795460c2b8ece0fcd70b
macintosh/adb: fix oob read in do_adb_query() function

commit 0b85b4999925fc2322f92f540aa33c05ec3792a8 upstream.

In do_adb_query() function of drivers/macintosh/adb.c, req->data is copied
form userland. The parameter "req->data[2]" is missing check, the array
size of adb_handler[] is 16, so adb_handler[req->data[2]].original_address and
adb_handler[req->data[2]].handler_id will lead to oob read.

Cc: stable <stable@kernel.org>
Signed-off-by: Ning Qiang <sohu0106@126.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220713153734.2248-1-sohu0106@126.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/macintosh/adb.c