]> 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)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 20 Jul 2022 12:06:30 +0000 (22:06 +1000)
commit7a807ee941293b0793dccc429610d8f45cd34e9d
treedf089f6c7100960025943d87557a07155a79bb88
parenteaa12fd0d35ed443daa94ff6a74a94a99b4f1ec7
macintosh/adb: fix oob read in do_adb_query() function

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
drivers/macintosh/adb.c