block: do not leak info to user-space
PATCH 1/1 block: do not leak info to user-space
From: Cong Wang <[email protected]>
There is a hole in struct hd_geometry, so we have to zero the struct on stack before copying it to user-space.
Cc Jens Axboe <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
block/compat_ioctl.c +1 -0
@@ -59,6 +59,7 @@ static int compat_hdio_getgeo(struct gendisk *disk, struct block_device *bdev,if (!disk->fops->getgeo)return -ENOTTY ; +memset (&geo,0 ,sizeof (geo));/* * We need to set the startsect first, the driver may * want to override it.