ibmasm: don't write out of bounds in read handler
authorJann Horn <jannh@google.com>
Sat, 7 Jul 2018 02:16:33 +0000 (04:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jul 2018 09:39:24 +0000 (11:39 +0200)
commit908bfe10dd14e8c4d858bed3e37c4748819f1bf6
tree4bb78b17b6e5896e7ac84316ca9c43095291f0c0
parentccb242ec502013f49c8c6117037e766c57c3a06b
ibmasm: don't write out of bounds in read handler

commit a0341fc1981a950c1e902ab901e98f60e0e243f3 upstream.

This read handler had a lot of custom logic and wrote outside the bounds of
the provided buffer. This could lead to kernel and userspace memory
corruption. Just use simple_read_from_buffer() with a stack buffer.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ibmasm/ibmasmfs.c