Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1377083
| From | Luis Henriques <luis.henriques@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.16.y-ckt 09/17] ipr: Fix regression when loading firmware |
| Date | 2016-04-12 20:20 +0200 |
| Message-ID | <rnb4R-3n3-1@gated-at.bofh.it> (permalink) |
| References | <rnaVc-3iR-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
3.16.7-ckt27 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
commit 21b81716c6bff24cda52dc75588455f879ddbfe9 upstream.
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>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
drivers/scsi/ipr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 824e66d7bf93..de2bfa24b91a 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3984,6 +3984,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))
@@ -3991,6 +3992,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;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[3.16.y-ckt stable] Linux 3.16.7-ckt27 stable review Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 14/17] x86/iopl/64: Properly context-switch IOPL on Xen PV Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 13/17] cpu: Provide smpboot_thread_init() on !CONFIG_SMP kernels as well Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 15/17] staging: comedi: ni_tiocmd: change mistaken use of start_src for start_arg Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 16/17] drm/radeon: hold reference to fences in radeon_sa_bo_new (3.17 and older) Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 04/17] ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk() Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:10 +0200
[PATCH 3.16.y-ckt 09/17] ipr: Fix regression when loading firmware Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 02/17] Input: powermate - fix oops with malicious USB descriptors Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 05/17] ALSA: usb-audio: Add sanity checks for endpoint accesses Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 12/17] ceph: fix request time stamp encoding Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 10/17] Input: ati_remote2 - fix crashes on detecting device with invalid descriptor Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 07/17] cpu: Defer smpboot kthread unparking until CPU known to scheduler Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 03/17] USB: iowarrior: fix oops with malicious USB descriptors Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 11/17] USB: cdc-acm: more sanity checking Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 08/17] ipr: Fix out-of-bounds null overwrite Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 01/17] ipv4: Don't do expensive useless work during inetdev destroy. Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
[PATCH 3.16.y-ckt 06/17] include/linux/poison.h: fix LIST_POISON{1,2} offset Luis Henriques <luis.henriques@canonical.com> - 2016-04-12 20:20 +0200
csiph-web