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.

Signed-off-by: Vasiliy Kulikov <>
Signed-off-by: Jens Axboe <>

(2.6 commit: a014741c0adfb8fb79952939ca087cf03d272bb9)
[WT: different fix from 2.6 because we could not centralize the ioctl, so
 all affected drivers had to be fixed ]
Signed-off-by: Willy Tarreau <>
11 files changed