Thread (1 message) 1 message, 1 author, 2016-08-09

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

From: Martin K. Petersen <hidden>
Date: 2016-08-09 01:10:35
Also in: lkml

quoted
quoted
quoted
quoted
"Calvin" == Calvin Owens [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help