RE: [PATCH 2/2] scsi: aacraid: Off by one NUL terminator

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

 



> 
> Dan,
> 
> > We're putting a NUL terminator one character beyond the end of the
> > struct and that's obviously wrong.  On the other hand, I'm not
> > positive this is the correct fix.  This change was added deliberately
> > and was mentioned in the changlog of commit b836439faf04 ("aacraid:
> > 4KB sector support").  The relevant section is "Also fix up a name
> > truncation problem".  Can someone review this code and figure out the
> > right thing to do?
> 
> I guess that's a feeble attempt to compensate for the fact it's not a C string. The
> string coming from the controller firmware appears to be a fixed 16-byte length.
> And so is the inquiry buffer that it's being copied to.
> 
> If the code would just use the inquiry string verbatim instead of removing
> leading spaces and padding it. But there was probably some crappy device out
> there that broke something for someone...

Hi Martin, Dan,

The issue is that we are making an inquiry response from container/RAID info. We could also have included a "pad" byte to terminate the string, as the fib data is 512 bytes. My assumption is that somehow back in the day, someone managed to get odd characters into the name.

Terminating the string early would truncate the name ...

-Dave
> 
> Anyway. Terminating the string is not the right fix.
> 
> --
> Martin K. Petersen      Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux