Hi!

On 10/25/2018 10:13 AM, Antti Kultanen wrote:
> Package: hdparm
> Version: 9.57+ds-1
> Severity: normal
> 
> 
> Expected result:
> hdparm -t displays the read speed of a virtual block device, like
> disk arrays and encrypted disks.
> 
> Actual result:
> hdparm -t segfaults.
> 
> -8<-
> root@hanuri ~ # hdparm -t /dev/mapper/backup
> 
> /dev/mapper/backup:
>  HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
> zsh: segmentation fault (core dumped)  hdparm -t /dev/mapper/backup
> root@hanuri ~ # hdparm -t /dev/md2          
> 
> /dev/md2:
>  HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
> zsh: segmentation fault (core dumped)  hdparm -t /dev/md2
> -8<-
> 
> Notes:
> The feature works with previous hdparm version 9.56+ds-2.

The attached patch seem to solve the issue, but I'll wait for the
upstream's solution.
--- hdparm.orig/hdparm.c
+++ hdparm/hdparm.c
@@ -1599,6 +1599,8 @@
 	unsigned int words = 256;
 
 	get_identify_data(fd);
+	if (! id)
+		return;
 	if((id[106] & 0xc000) == 0x4000) {
 		if (id[106] & (1<<12))
 			words = (id[118] << 16) | id[117];

Reply via email to