]> git.karo-electronics.de Git - karo-tx-linux.git/commit
virtio: console: Prevent userspace from submitting NULL buffers
authorAmit Shah <amit.shah@redhat.com>
Tue, 14 Sep 2010 07:56:16 +0000 (13:26 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Sep 2010 00:18:20 +0000 (17:18 -0700)
commitd4f5d4c1a4f45e69deb3bcf727e511b0637a72d1
treef5bb3677a4e7dfd2c1946edb7d40f2c702c7f60d
parentd987d040e9623502a97a9dd742377d4ec00e2ba2
virtio: console: Prevent userspace from submitting NULL buffers

commit 65745422a898741ee0e7068ef06624ab06e8aefa upstream.

A userspace could submit a buffer with 0 length to be written to the
host.  Prevent such a situation.

This was not needed previously, but recent changes in the way write()
works exposed this condition to trigger a virtqueue event to the host,
causing a NULL buffer to be sent across.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/virtio_console.c