Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458357

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

From "Martin K. Petersen" <martin.petersen@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated
Date 2016-08-09 03:20 +0200
Message-ID <s43S1-Lc-9@gated-at.bofh.it> (permalink)
References <rZLqG-1bP-7@gated-at.bofh.it>
Organization Oracle Corporation

Show all headers | View raw


>>>>> "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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated Calvin Owens <calvinowens@fb.com> - 2016-07-28 06:50 +0200
  Re: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-08-05 03:40 +0200
  RE: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated Chaitra Basappa <chaitra.basappa@broadcom.com> - 2016-08-05 08:50 +0200
  Re: [PATCH] mpt3sas: Ensure the connector_name string is NUL-terminated "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-08-09 03:20 +0200

csiph-web