From: Greg Kroah-Hartman Date: Fri, 27 Apr 2018 12:20:51 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v3.18.107~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c57d2f3760d27a56c9d969bc8718559ed60bd67f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch cdrom-information-leak-in-cdrom_ioctl_media_changed.patch s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch s390-dasd-fix-io-error-for-newly-defined-devices.patch s390-uprobes-implement-arch_uretprobe_is_alive.patch scsi-mptsas-disable-write-same.patch --- diff --git a/queue-4.9/acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch b/queue-4.9/acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch new file mode 100644 index 00000000000..7199fefc8ad --- /dev/null +++ b/queue-4.9/acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch @@ -0,0 +1,85 @@ +From 53fa1f6e8a5958da698a31edf366ffe90596b490 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 17 Apr 2018 18:23:50 +0200 +Subject: ACPI / video: Only default only_lcd to true on Win8-ready _desktops_ + +From: Hans de Goede + +commit 53fa1f6e8a5958da698a31edf366ffe90596b490 upstream. + +Commit 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready +and newer machines) made only_lcd default to true on all machines where +acpi_osi_is_win8() returns true, including laptops. + +The purpose of this is to avoid the bogus / non-working acpi backlight +interface which many newer BIOS-es define on desktop machines. + +But this is causing a regression on some laptops, specifically on the +Dell XPS 13 2013 model, which does not have the LCD flag set for its +fully functional ACPI backlight interface. + +Rather then DMI quirking our way out of this, this commits changes the +logic for setting only_lcd to true, to only do this on machines with +a desktop (or server) dmi chassis-type. + +Note that we cannot simply only check the chassis-type and not register +the backlight interface based on that as there are some laptops and +tablets which have their chassis-type set to "3" aka desktop. Hopefully +the combination of checking the LCD flag, but only on devices with +a desktop(ish) chassis-type will avoid the needs for DMI quirks for this, +or at least limit the amount of DMI quirks which we need to a minimum. + +Fixes: 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) +Reported-and-tested-by: James Hogan +Signed-off-by: Hans de Goede +Cc: 4.15+ # 4.15+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/acpi_video.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/acpi_video.c ++++ b/drivers/acpi/acpi_video.c +@@ -2069,6 +2069,25 @@ static int __init intel_opregion_present + return opregion; + } + ++static bool dmi_is_desktop(void) ++{ ++ const char *chassis_type; ++ ++ chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); ++ if (!chassis_type) ++ return false; ++ ++ if (!strcmp(chassis_type, "3") || /* 3: Desktop */ ++ !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */ ++ !strcmp(chassis_type, "5") || /* 5: Pizza Box */ ++ !strcmp(chassis_type, "6") || /* 6: Mini Tower */ ++ !strcmp(chassis_type, "7") || /* 7: Tower */ ++ !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */ ++ return true; ++ ++ return false; ++} ++ + int acpi_video_register(void) + { + int ret = 0; +@@ -2089,8 +2108,12 @@ int acpi_video_register(void) + * win8 ready (where we also prefer the native backlight driver, so + * normally the acpi_video code should not register there anyways). + */ +- if (only_lcd == -1) +- only_lcd = acpi_osi_is_win8(); ++ if (only_lcd == -1) { ++ if (dmi_is_desktop() && acpi_osi_is_win8()) ++ only_lcd = true; ++ else ++ only_lcd = false; ++ } + + dmi_check_system(video_dmi_table); + diff --git a/queue-4.9/cdrom-information-leak-in-cdrom_ioctl_media_changed.patch b/queue-4.9/cdrom-information-leak-in-cdrom_ioctl_media_changed.patch new file mode 100644 index 00000000000..e8d809a2f13 --- /dev/null +++ b/queue-4.9/cdrom-information-leak-in-cdrom_ioctl_media_changed.patch @@ -0,0 +1,36 @@ +From 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 18 Apr 2018 12:51:31 +0300 +Subject: cdrom: information leak in cdrom_ioctl_media_changed() + +From: Dan Carpenter + +commit 9de4ee40547fd315d4a0ed1dd15a2fa3559ad707 upstream. + +This cast is wrong. "cdi->capacity" is an int and "arg" is an unsigned +long. The way the check is written now, if one of the high 32 bits is +set then we could read outside the info->slots[] array. + +This bug is pretty old and it predates git. + +Reviewed-by: Christoph Hellwig +Cc: stable@vger.kernel.org +Signed-off-by: Dan Carpenter +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cdrom/cdrom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/cdrom/cdrom.c ++++ b/drivers/cdrom/cdrom.c +@@ -2368,7 +2368,7 @@ static int cdrom_ioctl_media_changed(str + if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT) + return media_changed(cdi, 1); + +- if ((unsigned int)arg >= cdi->capacity) ++ if (arg >= cdi->capacity) + return -EINVAL; + + info = kmalloc(sizeof(*info), GFP_KERNEL); diff --git a/queue-4.9/s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch b/queue-4.9/s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch new file mode 100644 index 00000000000..b63e9617b42 --- /dev/null +++ b/queue-4.9/s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch @@ -0,0 +1,56 @@ +From af2e460ade0b0180d0f3812ca4f4f59cc9597f3e Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Wed, 11 Apr 2018 11:21:17 +0200 +Subject: s390/cio: update chpid descriptor after resource accessibility event + +From: Sebastian Ott + +commit af2e460ade0b0180d0f3812ca4f4f59cc9597f3e upstream. + +Channel path descriptors have been seen as something stable (as +long as the chpid is configured). Recent tests have shown that the +descriptor can also be altered when the link state of a channel path +changes. Thus it is necessary to update the descriptor during +handling of resource accessibility events. + +Cc: +Signed-off-by: Sebastian Ott +Reviewed-by: Peter Oberparleiter +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/s390/cio/chsc.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/s390/cio/chsc.c ++++ b/drivers/s390/cio/chsc.c +@@ -451,6 +451,7 @@ static void chsc_process_sei_link_incide + + static void chsc_process_sei_res_acc(struct chsc_sei_nt0_area *sei_area) + { ++ struct channel_path *chp; + struct chp_link link; + struct chp_id chpid; + int status; +@@ -463,10 +464,17 @@ static void chsc_process_sei_res_acc(str + chpid.id = sei_area->rsid; + /* allocate a new channel path structure, if needed */ + status = chp_get_status(chpid); +- if (status < 0) +- chp_new(chpid); +- else if (!status) ++ if (!status) + return; ++ ++ if (status < 0) { ++ chp_new(chpid); ++ } else { ++ chp = chpid_to_chp(chpid); ++ mutex_lock(&chp->lock); ++ chp_update_desc(chp); ++ mutex_unlock(&chp->lock); ++ } + memset(&link, 0, sizeof(struct chp_link)); + link.chpid = chpid; + if ((sei_area->vf & 0xc0) != 0) { diff --git a/queue-4.9/s390-dasd-fix-io-error-for-newly-defined-devices.patch b/queue-4.9/s390-dasd-fix-io-error-for-newly-defined-devices.patch new file mode 100644 index 00000000000..c3f3d2edb75 --- /dev/null +++ b/queue-4.9/s390-dasd-fix-io-error-for-newly-defined-devices.patch @@ -0,0 +1,81 @@ +From 5d27a2bf6e14f5c7d1033ad1e993fcd0eba43e83 Mon Sep 17 00:00:00 2001 +From: Stefan Haberland +Date: Thu, 12 Apr 2018 13:38:22 +0200 +Subject: s390/dasd: fix IO error for newly defined devices + +From: Stefan Haberland + +commit 5d27a2bf6e14f5c7d1033ad1e993fcd0eba43e83 upstream. + +When a new CKD storage volume is defined at the storage server, Linux +may be relying on outdated information about that volume, which leads to +the following errors: + +1. Command Reject Errors for minidisk on z/VM: + +dasd-eckd.b3193d: 0.0.XXXX: An error occurred in the DASD device driver, + reason=09 +dasd(eckd): I/O status report for device 0.0.XXXX: +dasd(eckd): in req: 00000000XXXXXXXX CC:00 FC:04 AC:00 SC:17 DS:02 CS:00 + RC:0 +dasd(eckd): device 0.0.2046: Failing CCW: 00000000XXXXXXXX +dasd(eckd): Sense(hex) 0- 7: 80 00 00 00 00 00 00 00 +dasd(eckd): Sense(hex) 8-15: 00 00 00 00 00 00 00 00 +dasd(eckd): Sense(hex) 16-23: 00 00 00 00 e1 00 0f 00 +dasd(eckd): Sense(hex) 24-31: 00 00 40 e2 00 00 00 00 +dasd(eckd): 24 Byte: 0 MSG 0, no MSGb to SYSOP + +2. Equipment Check errors on LPAR or for dedicated devices on z/VM: + +dasd(eckd): I/O status report for device 0.0.XXXX: +dasd(eckd): in req: 00000000XXXXXXXX CC:00 FC:04 AC:00 SC:17 DS:0E CS:40 + fcxs:01 schxs:00 RC:0 +dasd(eckd): device 0.0.9713: Failing TCW: 00000000XXXXXXXX +dasd(eckd): Sense(hex) 0- 7: 10 00 00 00 13 58 4d 0f +dasd(eckd): Sense(hex) 8-15: 67 00 00 00 00 00 00 04 +dasd(eckd): Sense(hex) 16-23: e5 18 05 33 97 01 0f 0f +dasd(eckd): Sense(hex) 24-31: 00 00 40 e2 00 04 58 0d +dasd(eckd): 24 Byte: 0 MSG f, no MSGb to SYSOP + +Fix this problem by using the up-to-date information provided during +online processing via the device specific SNEQ to detect the case of +outdated LCU data. If there is a difference, perform a re-read of that +data. + +Cc: stable@vger.kernel.org +Reviewed-by: Jan Hoeppner +Signed-off-by: Stefan Haberland +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/s390/block/dasd_alias.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +--- a/drivers/s390/block/dasd_alias.c ++++ b/drivers/s390/block/dasd_alias.c +@@ -591,13 +591,22 @@ static int _schedule_lcu_update(struct a + int dasd_alias_add_device(struct dasd_device *device) + { + struct dasd_eckd_private *private = device->private; +- struct alias_lcu *lcu; ++ __u8 uaddr = private->uid.real_unit_addr; ++ struct alias_lcu *lcu = private->lcu; + unsigned long flags; + int rc; + +- lcu = private->lcu; + rc = 0; + spin_lock_irqsave(&lcu->lock, flags); ++ /* ++ * Check if device and lcu type differ. If so, the uac data may be ++ * outdated and needs to be updated. ++ */ ++ if (private->uid.type != lcu->uac->unit[uaddr].ua_type) { ++ lcu->flags |= UPDATE_PENDING; ++ DBF_DEV_EVENT(DBF_WARNING, device, "%s", ++ "uid type mismatch - trigger rescan"); ++ } + if (!(lcu->flags & UPDATE_PENDING)) { + rc = _add_device_to_lcu(lcu, device, device); + if (rc) diff --git a/queue-4.9/s390-uprobes-implement-arch_uretprobe_is_alive.patch b/queue-4.9/s390-uprobes-implement-arch_uretprobe_is_alive.patch new file mode 100644 index 00000000000..1708b553960 --- /dev/null +++ b/queue-4.9/s390-uprobes-implement-arch_uretprobe_is_alive.patch @@ -0,0 +1,46 @@ +From 783c3b53b9506db3e05daacfe34e0287eebb09d8 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Mon, 16 Apr 2018 12:22:24 +0200 +Subject: s390/uprobes: implement arch_uretprobe_is_alive() + +From: Heiko Carstens + +commit 783c3b53b9506db3e05daacfe34e0287eebb09d8 upstream. + +Implement s390 specific arch_uretprobe_is_alive() to avoid SIGSEGVs +observed with uretprobes in combination with setjmp/longjmp. + +See commit 2dea1d9c38e4 ("powerpc/uprobes: Implement +arch_uretprobe_is_alive()") for more details. + +With this implemented all test cases referenced in the above commit +pass. + +Reported-by: Ziqian SUN +Cc: # v4.3+ +Signed-off-by: Heiko Carstens +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/uprobes.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/arch/s390/kernel/uprobes.c ++++ b/arch/s390/kernel/uprobes.c +@@ -147,6 +147,15 @@ unsigned long arch_uretprobe_hijack_retu + return orig; + } + ++bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx, ++ struct pt_regs *regs) ++{ ++ if (ctx == RP_CHECK_CHAIN_CALL) ++ return user_stack_pointer(regs) <= ret->stack; ++ else ++ return user_stack_pointer(regs) < ret->stack; ++} ++ + /* Instruction Emulation */ + + static void adjust_psw_addr(psw_t *psw, unsigned long len) diff --git a/queue-4.9/scsi-mptsas-disable-write-same.patch b/queue-4.9/scsi-mptsas-disable-write-same.patch new file mode 100644 index 00000000000..dc6a51393bc --- /dev/null +++ b/queue-4.9/scsi-mptsas-disable-write-same.patch @@ -0,0 +1,31 @@ +From 94e5395d2403c8bc2504a7cbe4c4caaacb7b8b84 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Wed, 18 Apr 2018 22:54:59 -0400 +Subject: scsi: mptsas: Disable WRITE SAME + +From: Martin K. Petersen + +commit 94e5395d2403c8bc2504a7cbe4c4caaacb7b8b84 upstream. + +First generation MPT Fusion controllers can not translate WRITE SAME +when the attached device is a SATA drive. Disable WRITE SAME support. + +Reported-by: Nikola Ciprich +Cc: +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/message/fusion/mptsas.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/message/fusion/mptsas.c ++++ b/drivers/message/fusion/mptsas.c +@@ -1994,6 +1994,7 @@ static struct scsi_host_template mptsas_ + .cmd_per_lun = 7, + .use_clustering = ENABLE_CLUSTERING, + .shost_attrs = mptscsih_host_attrs, ++ .no_write_same = 1, + }; + + static int mptsas_get_linkerrors(struct sas_phy *phy) diff --git a/queue-4.9/series b/queue-4.9/series index e86dac37e4a..1348bb92dea 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -70,3 +70,9 @@ ipv6-add-rta_table-and-rta_prefsrc-to-rtm_ipv6_policy.patch strparser-fix-incorrect-strp-need_bytes-value.patch +scsi-mptsas-disable-write-same.patch +cdrom-information-leak-in-cdrom_ioctl_media_changed.patch +s390-cio-update-chpid-descriptor-after-resource-accessibility-event.patch +s390-dasd-fix-io-error-for-newly-defined-devices.patch +s390-uprobes-implement-arch_uretprobe_is_alive.patch +acpi-video-only-default-only_lcd-to-true-on-win8-ready-_desktops_.patch