Re: [PATCH v2] Setting 10_wwn.model name per lun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Damn.  I'm pretty sure I wrote an oboe bug here:

> +	if (configname) {
> +		strncpy(&dev->t10_wwn.model[0], configname, 16);
> +		if (strlen(configname) > 16) {
> +			pr_warn("dev[%p]: Backstore name '%s' is too long for "
> +                                "INQUIRY_MODEL, truncating to 16 bytes", dev, configname);
> +		}
> +		dev->t10_wwn.model[15] = '\0';
> +	}

strlen in kernel space doesn't include the terminating \0 character, so
in the boundary condition of a configname of exactly sixteen characters
we will truncate the last character of the configname without a warning.

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux