lkml.org 
[lkml]   [2016]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated
From
Date
>>>>> "Calvin" == Calvin Owens <calvinowens@fb.com> 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

\
 
 \ /
  Last update: 2016-08-09 03:41    [W:0.179 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site