linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org, Insu Yun <wuninsu@gmail.com>
Subject: Re: [PATCH] ipr: Fix regression when loading firmware
Date: Fri, 26 Feb 2016 14:52:56 -0600	[thread overview]
Message-ID: <56D0BB28.6040502@linux.vnet.ibm.com> (raw)
In-Reply-To: <1456419260-14916-1-git-send-email-krisman@linux.vnet.ibm.com>

On 02/25/2016 10:54 AM, Gabriel Krisman Bertazi wrote:
> Commit d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") removed the
> end of line handling when storing the update_fw sysfs attribute.  This
> changed the userpace API because it started refusing writes terminated
> by a line feed, which broke the update tools we already have.
> 
> This patch re-adds that handling, so both a write terminated by a line
> feed or not can make it through with the update.
> 
> Fixes: d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite")
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> Cc: Insu Yun <wuninsu@gmail.com>
> ---
>  drivers/scsi/ipr.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 3b3e099..d6a691e 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -4002,6 +4002,7 @@ static ssize_t ipr_store_update_fw(struct device *dev,
>  	struct ipr_sglist *sglist;
>  	char fname[100];
>  	char *src;
> +	char *endline;
>  	int result, dnld_size;
> 
>  	if (!capable(CAP_SYS_ADMIN))
> @@ -4009,6 +4010,10 @@ static ssize_t ipr_store_update_fw(struct device *dev,
> 
>  	snprintf(fname, sizeof(fname), "%s", buf);
> 
> +	endline = strchr(fname, '\n');
> +	if (endline)
> +		*endline = '\0';
> +
>  	if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) {
>  		dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname);
>  		return -EIO;
> 

Acked-by: Brian King <brking@linux.vnet.ibm.com>

James - since this is a regression, can we get this fix in for 4.5 yet?

Thanks,

Brian

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


  reply	other threads:[~2016-02-26 20:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 16:54 [PATCH] ipr: Fix regression when loading firmware Gabriel Krisman Bertazi
2016-02-26 20:52 ` Brian King [this message]
2016-02-26 21:04   ` James Bottomley
2016-02-26 22:26 ` Martin K. Petersen

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=56D0BB28.6040502@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=krisman@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wuninsu@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).