ide-tape: Don't leak kernel stack information
Don't leak kernel stack information through uninitialized structure members. Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-by: Borislav Petkov <petkovbb@gmail.com>. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
bc146d23d1
Коммит
2fc2111c27
|
@ -1064,6 +1064,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd,
|
||||||
tape->best_dsc_rw_freq = config.dsc_rw_frequency;
|
tape->best_dsc_rw_freq = config.dsc_rw_frequency;
|
||||||
break;
|
break;
|
||||||
case 0x0350:
|
case 0x0350:
|
||||||
|
memset(&config, 0, sizeof(config));
|
||||||
config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
|
config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
|
||||||
config.nr_stages = 1;
|
config.nr_stages = 1;
|
||||||
if (copy_to_user(argp, &config, sizeof(config)))
|
if (copy_to_user(argp, &config, sizeof(config)))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче