public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ferenc Wagner <wferi@niif.hu>
Cc: Kashyap@tac.ki.iif.hu, Desai <kashyap.desai@lsi.com>,
	support@lsi.com, DL-MPTFusionLinux@lsi.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [SCSI] fusion: ensure NUL-termination of MptCallbacksName elements
Date: Thu, 25 Aug 2011 14:59:15 -0700	[thread overview]
Message-ID: <20110825145915.abde72e2.akpm@linux-foundation.org> (raw)
In-Reply-To: <cd21dfb714e3a89aadd8eda1fda1748dec9ed7aa.1314276422.git.wferi@niif.hu>

On Thu, 25 Aug 2011 14:44:57 +0200
Ferenc Wagner <wferi@niif.hu> wrote:

> Signed-off-by: Ferenc Wagner <wferi@niif.hu>

The lack of a changelog is a hint that the patch needed a changelog!

> 
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
> index 7956a10..eb906e2 100644
> --- a/drivers/message/fusion/mptbase.c
> +++ b/drivers/message/fusion/mptbase.c
> @@ -113,7 +113,7 @@ module_param(mpt_fwfault_debug, int, 0600);
>  MODULE_PARM_DESC(mpt_fwfault_debug,
>  		 "Enable detection of Firmware fault and halt Firmware on fault - (default=0)");
>  
> -static char	MptCallbacksName[MPT_MAX_PROTOCOL_DRIVERS][50];
> +static char	MptCallbacksName[MPT_MAX_PROTOCOL_DRIVERS][MPT_MAX_CALLBACKNAME_LEN+1];
>  
>  #ifdef MFCNT
>  static int mfcounter = 0;
> @@ -656,8 +656,7 @@ mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass, char *func_name)
>  			MptDriverClass[cb_idx] = dclass;
>  			MptEvHandlers[cb_idx] = NULL;
>  			last_drv_idx = cb_idx;
> -			memcpy(MptCallbacksName[cb_idx], func_name,
> -			    strlen(func_name) > 50 ? 50 : strlen(func_name));
> +			strlcpy(MptCallbacksName[cb_idx], func_name, MPT_MAX_CALLBACKNAME_LEN+1);
>  			break;
>  		}
>  	}
> diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
> index fe90233..c10416d 100644
> --- a/drivers/message/fusion/mptbase.h
> +++ b/drivers/message/fusion/mptbase.h
> @@ -89,6 +89,7 @@
>   */
>  #define MPT_MAX_ADAPTERS		18
>  #define MPT_MAX_PROTOCOL_DRIVERS	16
> +#define MPT_MAX_CALLBACKNAME_LEN	49
>  #define MPT_MAX_BUS			1	/* Do not change */
>  #define MPT_MAX_FC_DEVICES		255
>  #define MPT_MAX_SCSI_DEVICES		16

Does the patch fix some real-world observed problem?  If so, please
fully describe it.

  parent reply	other threads:[~2011-08-25 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 12:44 [PATCH] [SCSI] fusion: ensure NUL-termination of MptCallbacksName elements Ferenc Wagner
2011-08-25 12:44 ` [PATCH v2] SCSI: " Ferenc Wagner
2011-11-28  7:02   ` Nandigama, Nagalakshmi
2011-08-25 21:59 ` Andrew Morton [this message]
2011-08-26 17:01   ` [PATCH] [SCSI] " Ferenc Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110825145915.abde72e2.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=Kashyap@tac.ki.iif.hu \
    --cc=kashyap.desai@lsi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=support@lsi.com \
    --cc=wferi@niif.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox