Re: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated

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

 



>>>>> "Calvin" == Calvin Owens <calvinowens@xxxxxx> writes:

Calvin> We blindly trust the hardware to give us NUL-terminated strings,
Calvin> which is a bad idea because it doesn't always do that. For
Calvin> example:

Calvin>   [ 481.184784] mpt3sas_cm0: enclosure level(0x0000), connector
Calvin> name( \x3)

Calvin> In this case, connector_name is four spaces. We got lucky here
Calvin> because the 2nd byte beyond our character array happens to be a
Calvin> NUL. Fix this by explicitly writing '\0' to the end of the
Calvin> string to ensure we don't run off the edge of the world in
Calvin> printk().

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux