Re: [PATCH] scsi: ibmvscsi: Improve strings handling

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

 



Breno,

> Currently an open firmware property is copied into partition_name
> variable without keeping a room for \0.
>
> Later one, this variable (partition_name), which is 97 bytes long, is
> strncpyed into ibmvcsci_host_data->madapter_info->partition_name,
> which is 96 bytes long, possibly truncating it 'again' and removing
> the \0.
>
> This patch simply decreases the partition name to 96 and just copy
> using strlcpy() which guarantees that the string is \0 terminated. I
> think there is no issue if this there is a truncation in this very
> first copy, i.e, when the open firmware property is read and copied
> into the driver for the very first time;

Applied to 4.19/scsi-queue, thanks.

-- 
Martin K. Petersen	Oracle Linux Engineering



[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