block: ioctl: fix information leak to userland
authorVasiliy Kulikov <segooon@gmail.com>
Mon, 8 Nov 2010 13:42:40 +0000 (14:42 +0100)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 10 Nov 2010 13:40:53 +0000 (14:40 +0100)
commita014741c0adfb8fb79952939ca087cf03d272bb9
tree57bafa05736f172b94fde156bb51798b3ddb6107
parent77304d2abac6101f7249754ffdd4421258877ab0
block: ioctl: fix information leak to userland

Structure hd_geometry is copied to userland with 4 padding bytes
between cylinders and start fields uninitialized on 64-bit platforms.
It leads to leaking of contents of kernel stack memory.

Currently there is no memset() in real implementations of getgeo()
in drivers/block/, so it makes sense to have memset() in blkdev_ioctl().

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/ioctl.c