From: Greg Kroah-Hartman Date: Thu, 18 Aug 2016 13:28:53 +0000 (+0200) Subject: 4.7-stable patches X-Git-Tag: v3.14.77~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32057ab8c91fc99afe110dabe4080f3b15867814;p=thirdparty%2Fkernel%2Fstable-queue.git 4.7-stable patches added patches: dm-flakey-error-read-bios-during-the-down_interval.patch documentation-module-signing.txt-note-need-for-version-info-if-reusing-a-key.patch module-invalidate-signatures-on-force-loaded-modules.patch phy-rcar-gen3-usb2-fix-mutex_lock-calling-in-interrupt.patch rtc-s3c-add-s3c_rtc_-enable-disable-_clk-in-s3c_rtc_setfreq.patch --- diff --git a/queue-4.7/dm-flakey-error-read-bios-during-the-down_interval.patch b/queue-4.7/dm-flakey-error-read-bios-during-the-down_interval.patch new file mode 100644 index 00000000000..7573afbeb1c --- /dev/null +++ b/queue-4.7/dm-flakey-error-read-bios-during-the-down_interval.patch @@ -0,0 +1,68 @@ +From 99f3c90d0d85708e7401a81ce3314e50bf7f2819 Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +Date: Fri, 29 Jul 2016 13:19:55 -0400 +Subject: dm flakey: error READ bios during the down_interval + +From: Mike Snitzer + +commit 99f3c90d0d85708e7401a81ce3314e50bf7f2819 upstream. + +When the corrupt_bio_byte feature was introduced it caused READ bios to +no longer be errored with -EIO during the down_interval. This had to do +with the complexity of needing to submit READs if the corrupt_bio_byte +feature was used. + +Fix it so READ bios are properly errored with -EIO; doing so early in +flakey_map() as long as there isn't a match for the corrupt_bio_byte +feature. + +Fixes: a3998799fb4df ("dm flakey: add corrupt_bio_byte feature") +Reported-by: Akira Hayakawa +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-flakey.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +--- a/drivers/md/dm-flakey.c ++++ b/drivers/md/dm-flakey.c +@@ -289,10 +289,16 @@ static int flakey_map(struct dm_target * + pb->bio_submitted = true; + + /* +- * Map reads as normal. ++ * Map reads as normal only if corrupt_bio_byte set. + */ +- if (bio_data_dir(bio) == READ) +- goto map_bio; ++ if (bio_data_dir(bio) == READ) { ++ /* If flags were specified, only corrupt those that match. */ ++ if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && ++ all_corrupt_bio_flags_match(bio, fc)) ++ goto map_bio; ++ else ++ return -EIO; ++ } + + /* + * Drop writes? +@@ -330,12 +336,13 @@ static int flakey_end_io(struct dm_targe + + /* + * Corrupt successful READs while in down state. +- * If flags were specified, only corrupt those that match. + */ +- if (fc->corrupt_bio_byte && !error && pb->bio_submitted && +- (bio_data_dir(bio) == READ) && (fc->corrupt_bio_rw == READ) && +- all_corrupt_bio_flags_match(bio, fc)) +- corrupt_bio_data(bio, fc); ++ if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) { ++ if (fc->corrupt_bio_byte) ++ corrupt_bio_data(bio, fc); ++ else ++ return -EIO; ++ } + + return error; + } diff --git a/queue-4.7/documentation-module-signing.txt-note-need-for-version-info-if-reusing-a-key.patch b/queue-4.7/documentation-module-signing.txt-note-need-for-version-info-if-reusing-a-key.patch new file mode 100644 index 00000000000..84e540685cd --- /dev/null +++ b/queue-4.7/documentation-module-signing.txt-note-need-for-version-info-if-reusing-a-key.patch @@ -0,0 +1,34 @@ +From b8612e517c3c9809e1200b72c474dbfd969e5a83 Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Thu, 28 Apr 2016 09:24:05 +0930 +Subject: Documentation/module-signing.txt: Note need for version info if reusing a key + +From: Ben Hutchings + +commit b8612e517c3c9809e1200b72c474dbfd969e5a83 upstream. + +Signing a module should only make it trusted by the specific kernel it +was built for, not anything else. If a module signing key is used for +multiple ABI-incompatible kernels, the modules need to include enough +version information to distinguish them. + +Signed-off-by: Ben Hutchings +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/module-signing.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/Documentation/module-signing.txt ++++ b/Documentation/module-signing.txt +@@ -271,3 +271,9 @@ Since the private key is used to sign mo + the private key to sign modules and compromise the operating system. The + private key must be either destroyed or moved to a secure location and not kept + in the root node of the kernel source tree. ++ ++If you use the same private key to sign modules for multiple kernel ++configurations, you must ensure that the module version information is ++sufficient to prevent loading a module into a different kernel. Either ++set CONFIG_MODVERSIONS=y or ensure that each configuration has a different ++kernel release string by changing EXTRAVERSION or CONFIG_LOCALVERSION. diff --git a/queue-4.7/module-invalidate-signatures-on-force-loaded-modules.patch b/queue-4.7/module-invalidate-signatures-on-force-loaded-modules.patch new file mode 100644 index 00000000000..049c836f7d2 --- /dev/null +++ b/queue-4.7/module-invalidate-signatures-on-force-loaded-modules.patch @@ -0,0 +1,64 @@ +From bca014caaa6130e57f69b5bf527967aa8ee70fdd Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Thu, 28 Apr 2016 09:24:01 +0930 +Subject: module: Invalidate signatures on force-loaded modules + +From: Ben Hutchings + +commit bca014caaa6130e57f69b5bf527967aa8ee70fdd upstream. + +Signing a module should only make it trusted by the specific kernel it +was built for, not anything else. Loading a signed module meant for a +kernel with a different ABI could have interesting effects. +Therefore, treat all signatures as invalid when a module is +force-loaded. + +Signed-off-by: Ben Hutchings +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/module.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2687,13 +2687,18 @@ static inline void kmemleak_load_module( + #endif + + #ifdef CONFIG_MODULE_SIG +-static int module_sig_check(struct load_info *info) ++static int module_sig_check(struct load_info *info, int flags) + { + int err = -ENOKEY; + const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1; + const void *mod = info->hdr; + +- if (info->len > markerlen && ++ /* ++ * Require flags == 0, as a module with version information ++ * removed is no longer the module that was signed ++ */ ++ if (flags == 0 && ++ info->len > markerlen && + memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) { + /* We truncate the module to discard the signature */ + info->len -= markerlen; +@@ -2712,7 +2717,7 @@ static int module_sig_check(struct load_ + return err; + } + #else /* !CONFIG_MODULE_SIG */ +-static int module_sig_check(struct load_info *info) ++static int module_sig_check(struct load_info *info, int flags) + { + return 0; + } +@@ -3498,7 +3503,7 @@ static int load_module(struct load_info + long err; + char *after_dashes; + +- err = module_sig_check(info); ++ err = module_sig_check(info, flags); + if (err) + goto free_copy; + diff --git a/queue-4.7/phy-rcar-gen3-usb2-fix-mutex_lock-calling-in-interrupt.patch b/queue-4.7/phy-rcar-gen3-usb2-fix-mutex_lock-calling-in-interrupt.patch new file mode 100644 index 00000000000..707ade21b13 --- /dev/null +++ b/queue-4.7/phy-rcar-gen3-usb2-fix-mutex_lock-calling-in-interrupt.patch @@ -0,0 +1,118 @@ +From c14f8a4032efa73d9c4e155add47c19252b3bdf4 Mon Sep 17 00:00:00 2001 +From: Yoshihiro Shimoda +Date: Mon, 27 Jun 2016 15:36:53 +0900 +Subject: phy: rcar-gen3-usb2: fix mutex_lock calling in interrupt + +From: Yoshihiro Shimoda + +commit c14f8a4032efa73d9c4e155add47c19252b3bdf4 upstream. + +This patch fixes an issue that the extcon_set_cable_state_() is possible +to cause "BUG: scheduling while atomic" because this driver calls +extcon_set_cable_state_() in the interrupt handler and mutex_lock() +is possible to be called by like the following call trace. +So, this patch adds a workqueue function to resolve this issue. + +[ 9.706504] BUG: scheduling while atomic: systemd-journal/25893/0x00010303 +[ 9.714569] Modules linked in: +[ 9.717629] CPU: 0 PID: 25893 Comm: systemd-journal Not tainted 4.7.0-rc4+ #86 +[ 9.724844] Hardware name: Renesas Salvator-X board based on r8a7795 (DT) +[ 9.731624] Call trace: +[ 9.734077] [] dump_backtrace+0x0/0x1a8 +[ 9.739470] [] show_stack+0x14/0x20 +[ 9.744520] [] dump_stack+0x94/0xb8 +[ 9.749568] [] __schedule_bug+0x44/0x58 +[ 9.754966] [] __schedule+0x4e4/0x598 +[ 9.760185] [] schedule+0x3c/0xa8 +[ 9.765057] [] schedule_preempt_disabled+0x20/0x38 +[ 9.771408] [] mutex_optimistic_spin+0x18c/0x1d0 +[ 9.777583] [] __mutex_lock_slowpath+0x38/0x140 +[ 9.783669] [] mutex_lock+0x44/0x60 +[ 9.788717] [] kobject_uevent_env+0x250/0x500 +[ 9.794634] [] extcon_update_state+0x220/0x298 +[ 9.800634] [] extcon_set_cable_state_+0x78/0x88 +[ 9.806812] [] rcar_gen3_device_recognition+0x5c/0xe0 +[ 9.813420] [] rcar_gen3_phy_usb2_irq+0x3c/0x48 +[ 9.819509] [] handle_irq_event_percpu+0x94/0x140 +[ 9.825769] [] handle_irq_event+0x48/0x78 +[ 9.831334] [] handle_fasteoi_irq+0xb8/0x1b0 +[ 9.837162] [] generic_handle_irq+0x24/0x38 +[ 9.842900] [] __handle_domain_irq+0x5c/0xb8 +[ 9.848727] [] gic_handle_irq+0x58/0xb0 + +Reported-by: Simon Horman +Fixes: 2b38543c8db1 ("phy: rcar-gen3-usb2: add extcon support") +Signed-off-by: Yoshihiro Shimoda +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/phy/phy-rcar-gen3-usb2.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +--- a/drivers/phy/phy-rcar-gen3-usb2.c ++++ b/drivers/phy/phy-rcar-gen3-usb2.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + /******* USB2.0 Host registers (original offset is +0x200) *******/ + #define USB2_INT_ENABLE 0x000 +@@ -81,9 +82,25 @@ struct rcar_gen3_chan { + struct extcon_dev *extcon; + struct phy *phy; + struct regulator *vbus; ++ struct work_struct work; ++ bool extcon_host; + bool has_otg; + }; + ++static void rcar_gen3_phy_usb2_work(struct work_struct *work) ++{ ++ struct rcar_gen3_chan *ch = container_of(work, struct rcar_gen3_chan, ++ work); ++ ++ if (ch->extcon_host) { ++ extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true); ++ extcon_set_cable_state_(ch->extcon, EXTCON_USB, false); ++ } else { ++ extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false); ++ extcon_set_cable_state_(ch->extcon, EXTCON_USB, true); ++ } ++} ++ + static void rcar_gen3_set_host_mode(struct rcar_gen3_chan *ch, int host) + { + void __iomem *usb2_base = ch->base; +@@ -130,8 +147,8 @@ static void rcar_gen3_init_for_host(stru + rcar_gen3_set_host_mode(ch, 1); + rcar_gen3_enable_vbus_ctrl(ch, 1); + +- extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true); +- extcon_set_cable_state_(ch->extcon, EXTCON_USB, false); ++ ch->extcon_host = true; ++ schedule_work(&ch->work); + } + + static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch) +@@ -140,8 +157,8 @@ static void rcar_gen3_init_for_peri(stru + rcar_gen3_set_host_mode(ch, 0); + rcar_gen3_enable_vbus_ctrl(ch, 0); + +- extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false); +- extcon_set_cable_state_(ch->extcon, EXTCON_USB, true); ++ ch->extcon_host = false; ++ schedule_work(&ch->work); + } + + static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch) +@@ -301,6 +318,7 @@ static int rcar_gen3_phy_usb2_probe(stru + if (irq >= 0) { + int ret; + ++ INIT_WORK(&channel->work, rcar_gen3_phy_usb2_work); + irq = devm_request_irq(dev, irq, rcar_gen3_phy_usb2_irq, + IRQF_SHARED, dev_name(dev), channel); + if (irq < 0) diff --git a/queue-4.7/rtc-s3c-add-s3c_rtc_-enable-disable-_clk-in-s3c_rtc_setfreq.patch b/queue-4.7/rtc-s3c-add-s3c_rtc_-enable-disable-_clk-in-s3c_rtc_setfreq.patch new file mode 100644 index 00000000000..b7ccbb99f35 --- /dev/null +++ b/queue-4.7/rtc-s3c-add-s3c_rtc_-enable-disable-_clk-in-s3c_rtc_setfreq.patch @@ -0,0 +1,50 @@ +From 70c96dfac0e231424e17743bd52f6cd2ff1f2439 Mon Sep 17 00:00:00 2001 +From: Alim Akhtar +Date: Tue, 5 Jul 2016 15:28:53 +0530 +Subject: rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq() + +From: Alim Akhtar + +commit 70c96dfac0e231424e17743bd52f6cd2ff1f2439 upstream. + +As per code flow s3c_rtc_setfreq() will get called with rtc clock disabled +and in set_freq we perform h/w registers read/write, which results in a +kernel crash on exynos7 platform while probing rtc driver. +Below is code flow: +s3c_rtc_probe() + clk_prepare_enable(info->rtc_clk) // rtc clock enabled + s3c_rtc_gettime() // will enable clk if not done, and disable it upon exit + s3c_rtc_setfreq() //then this will be called with clk disabled + +This patch take cares of such issue by adding s3c_rtc_{enable/disable}_clk in +s3c_rtc_setfreq(). + +Fixes: 24e1455493da ("drivers/rtc/rtc-s3c.c: delete duplicate clock control") +Signed-off-by: Alim Akhtar +Reviewed-by: Krzysztof Kozlowski +Reviewed-by: Pankaj Dubey +Tested-by: Pankaj Dubey +Signed-off-by: Alexandre Belloni +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rtc/rtc-s3c.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/rtc/rtc-s3c.c ++++ b/drivers/rtc/rtc-s3c.c +@@ -149,12 +149,14 @@ static int s3c_rtc_setfreq(struct s3c_rt + if (!is_power_of_2(freq)) + return -EINVAL; + ++ s3c_rtc_enable_clk(info); + spin_lock_irq(&info->pie_lock); + + if (info->data->set_freq) + info->data->set_freq(info, freq); + + spin_unlock_irq(&info->pie_lock); ++ s3c_rtc_disable_clk(info); + + return 0; + } diff --git a/queue-4.7/series b/queue-4.7/series index 96520cb2440..dbc08392bd5 100644 --- a/queue-4.7/series +++ b/queue-4.7/series @@ -179,3 +179,8 @@ pci-mark-atheros-ar9485-and-qca9882-to-avoid-bus-reset.patch x86-platform-intel_mid_pci-rework-irq0-workaround.patch acpi-ec-work-around-method-reentrancy-limit-in-acpica-for-_qxx.patch lpfc-fix-oops-in-lpfc_sli4_scmd_to_wqidx_distr-from-lpfc_send_taskmgmt.patch +rtc-s3c-add-s3c_rtc_-enable-disable-_clk-in-s3c_rtc_setfreq.patch +dm-flakey-error-read-bios-during-the-down_interval.patch +module-invalidate-signatures-on-force-loaded-modules.patch +documentation-module-signing.txt-note-need-for-version-info-if-reusing-a-key.patch +phy-rcar-gen3-usb2-fix-mutex_lock-calling-in-interrupt.patch