virtio-console: avoid DMA from stack
authorOmar Sandoval <osandov@fb.com>
Wed, 1 Feb 2017 08:02:27 +0000 (00:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Apr 2017 07:32:42 +0000 (09:32 +0200)
commite5349c13c7a8bd6e0be0f81f4464fc2edae05d5b
treecf82a76a8c8cf60098711c1a0759ae6ece20014e
parente0116f4d9a9ad5112d315b236c7b3d7036d404d7
virtio-console: avoid DMA from stack

commit c4baad50297d84bde1a7ad45e50c73adae4a2192 upstream.

put_chars() stuffs the buffer it gets into an sg, but that buffer may be
on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it
manifested as printks getting turned into NUL bytes).

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/virtio_console.c