From: Sasha Levin Date: Mon, 1 Apr 2019 15:20:22 +0000 (-0400) Subject: fixes for 4.4 X-Git-Tag: v3.18.138~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d4fccacd67d1596d5bbfcb3d6d95b65cd92e38e;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/arm64-support-keyctl-system-call-in-32-bit-mode.patch b/queue-4.4/arm64-support-keyctl-system-call-in-32-bit-mode.patch new file mode 100644 index 00000000000..d369ef92840 --- /dev/null +++ b/queue-4.4/arm64-support-keyctl-system-call-in-32-bit-mode.patch @@ -0,0 +1,37 @@ +From 0af8fbc7613c5018cb1b65add30d123d161afbe3 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Wed, 8 Mar 2017 16:27:04 -0800 +Subject: arm64: support keyctl() system call in 32-bit mode + +[ Upstream commit 5c2a625937ba49bc691089370638223d310cda9a ] + +As is the case for a number of other architectures that have a 32-bit +compat mode, enable KEYS_COMPAT if both COMPAT and KEYS are enabled. +This allows AArch32 programs to use the keyctl() system call when +running on an AArch64 kernel. + +Signed-off-by: Eric Biggers +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/Kconfig | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index 00c491750918..f18b8c26a959 100644 +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -818,6 +818,10 @@ config SYSVIPC_COMPAT + def_bool y + depends on COMPAT && SYSVIPC + ++config KEYS_COMPAT ++ def_bool y ++ depends on COMPAT && KEYS ++ + endmenu + + menu "Power management options" +-- +2.19.1 + diff --git a/queue-4.4/coresight-removing-bind-unbind-options-from-sysfs.patch b/queue-4.4/coresight-removing-bind-unbind-options-from-sysfs.patch new file mode 100644 index 00000000000..6f4f79eb44f --- /dev/null +++ b/queue-4.4/coresight-removing-bind-unbind-options-from-sysfs.patch @@ -0,0 +1,309 @@ +From d40e58e499f8ed3ca1ea1c508594ecac2923ea6d Mon Sep 17 00:00:00 2001 +From: Mathieu Poirier +Date: Tue, 2 Feb 2016 14:14:00 -0700 +Subject: coresight: removing bind/unbind options from sysfs + +[ Upstream commit b15f0fb657e040401d875d11ae13b269af8a16e0 ] + +The coresight drivers have absolutely no control over bind and unbind +operations triggered from sysfs. The operations simply can't be +cancelled or denied event when one or several tracing sessions are +under way. Since the memory associated to individual device is +invariably freed, the end result is a kernel crash when the path from +source to sink is travelled again as demonstrated here[1]. + +One solution could be to keep track of all the path (i.e tracing +session) that get created and iterate through the elements of those path +looking for the coresight device that is being removed. This proposition +doesn't scale well since there is no upper bound on the amount of +concurrent trace session that can be created. + +With the above in mind, this patch prevent devices from being unbounded +from their driver by using the driver->suppress_bind_attr option. That way +trace sessions can be managed without fearing to loose devices. + +Since device can't be removed anymore the xyz_remove() functions found in +each driver is also removed. + +[1]. http://www.spinics.net/lists/arm-kernel/msg474952.html + +Reported-by: Rabin Vincent +Signed-off-by: Mathieu Poirier +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/hwtracing/coresight/coresight-etb10.c | 11 +---------- + drivers/hwtracing/coresight/coresight-etm3x.c | 13 +------------ + drivers/hwtracing/coresight/coresight-etm4x.c | 13 +------------ + drivers/hwtracing/coresight/coresight-funnel.c | 10 +--------- + .../coresight/coresight-replicator-qcom.c | 11 +---------- + .../hwtracing/coresight/coresight-replicator.c | 16 +--------------- + drivers/hwtracing/coresight/coresight-tmc.c | 15 +-------------- + drivers/hwtracing/coresight/coresight-tpiu.c | 10 +--------- + 8 files changed, 8 insertions(+), 91 deletions(-) + +diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c +index 77d0f9c1118d..92969dae739d 100644 +--- a/drivers/hwtracing/coresight/coresight-etb10.c ++++ b/drivers/hwtracing/coresight/coresight-etb10.c +@@ -489,15 +489,6 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id) + return ret; + } + +-static int etb_remove(struct amba_device *adev) +-{ +- struct etb_drvdata *drvdata = amba_get_drvdata(adev); +- +- misc_deregister(&drvdata->miscdev); +- coresight_unregister(drvdata->csdev); +- return 0; +-} +- + #ifdef CONFIG_PM + static int etb_runtime_suspend(struct device *dev) + { +@@ -537,10 +528,10 @@ static struct amba_driver etb_driver = { + .name = "coresight-etb10", + .owner = THIS_MODULE, + .pm = &etb_dev_pm_ops, ++ .suppress_bind_attrs = true, + + }, + .probe = etb_probe, +- .remove = etb_remove, + .id_table = etb_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c +index d630b7ece735..5981fcc69960 100644 +--- a/drivers/hwtracing/coresight/coresight-etm3x.c ++++ b/drivers/hwtracing/coresight/coresight-etm3x.c +@@ -1877,17 +1877,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) + return ret; + } + +-static int etm_remove(struct amba_device *adev) +-{ +- struct etm_drvdata *drvdata = amba_get_drvdata(adev); +- +- coresight_unregister(drvdata->csdev); +- if (--etm_count == 0) +- unregister_hotcpu_notifier(&etm_cpu_notifier); +- +- return 0; +-} +- + #ifdef CONFIG_PM + static int etm_runtime_suspend(struct device *dev) + { +@@ -1948,9 +1937,9 @@ static struct amba_driver etm_driver = { + .name = "coresight-etm3x", + .owner = THIS_MODULE, + .pm = &etm_dev_pm_ops, ++ .suppress_bind_attrs = true, + }, + .probe = etm_probe, +- .remove = etm_remove, + .id_table = etm_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c +index 1ec6798b21e8..0edc10b44004 100644 +--- a/drivers/hwtracing/coresight/coresight-etm4x.c ++++ b/drivers/hwtracing/coresight/coresight-etm4x.c +@@ -2684,17 +2684,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) + return ret; + } + +-static int etm4_remove(struct amba_device *adev) +-{ +- struct etmv4_drvdata *drvdata = amba_get_drvdata(adev); +- +- coresight_unregister(drvdata->csdev); +- if (--etm4_count == 0) +- unregister_hotcpu_notifier(&etm4_cpu_notifier); +- +- return 0; +-} +- + static struct amba_id etm4_ids[] = { + { /* ETM 4.0 - Qualcomm */ + .id = 0x0003b95d, +@@ -2712,9 +2701,9 @@ static struct amba_id etm4_ids[] = { + static struct amba_driver etm4x_driver = { + .drv = { + .name = "coresight-etm4x", ++ .suppress_bind_attrs = true, + }, + .probe = etm4_probe, +- .remove = etm4_remove, + .id_table = etm4_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c +index 2e36bde7fcb4..25e8ea140a09 100644 +--- a/drivers/hwtracing/coresight/coresight-funnel.c ++++ b/drivers/hwtracing/coresight/coresight-funnel.c +@@ -226,14 +226,6 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) + return 0; + } + +-static int funnel_remove(struct amba_device *adev) +-{ +- struct funnel_drvdata *drvdata = amba_get_drvdata(adev); +- +- coresight_unregister(drvdata->csdev); +- return 0; +-} +- + #ifdef CONFIG_PM + static int funnel_runtime_suspend(struct device *dev) + { +@@ -273,9 +265,9 @@ static struct amba_driver funnel_driver = { + .name = "coresight-funnel", + .owner = THIS_MODULE, + .pm = &funnel_dev_pm_ops, ++ .suppress_bind_attrs = true, + }, + .probe = funnel_probe, +- .remove = funnel_remove, + .id_table = funnel_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-replicator-qcom.c b/drivers/hwtracing/coresight/coresight-replicator-qcom.c +index 584059e9e866..444815179460 100644 +--- a/drivers/hwtracing/coresight/coresight-replicator-qcom.c ++++ b/drivers/hwtracing/coresight/coresight-replicator-qcom.c +@@ -156,15 +156,6 @@ static int replicator_probe(struct amba_device *adev, const struct amba_id *id) + return 0; + } + +-static int replicator_remove(struct amba_device *adev) +-{ +- struct replicator_state *drvdata = amba_get_drvdata(adev); +- +- pm_runtime_disable(&adev->dev); +- coresight_unregister(drvdata->csdev); +- return 0; +-} +- + #ifdef CONFIG_PM + static int replicator_runtime_suspend(struct device *dev) + { +@@ -206,9 +197,9 @@ static struct amba_driver replicator_driver = { + .drv = { + .name = "coresight-replicator-qcom", + .pm = &replicator_dev_pm_ops, ++ .suppress_bind_attrs = true, + }, + .probe = replicator_probe, +- .remove = replicator_remove, + .id_table = replicator_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c +index 963ac197c253..b77d700a3f0e 100644 +--- a/drivers/hwtracing/coresight/coresight-replicator.c ++++ b/drivers/hwtracing/coresight/coresight-replicator.c +@@ -127,20 +127,6 @@ static int replicator_probe(struct platform_device *pdev) + return ret; + } + +-static int replicator_remove(struct platform_device *pdev) +-{ +- struct replicator_drvdata *drvdata = platform_get_drvdata(pdev); +- +- coresight_unregister(drvdata->csdev); +- pm_runtime_get_sync(&pdev->dev); +- if (!IS_ERR(drvdata->atclk)) +- clk_disable_unprepare(drvdata->atclk); +- pm_runtime_put_noidle(&pdev->dev); +- pm_runtime_disable(&pdev->dev); +- +- return 0; +-} +- + #ifdef CONFIG_PM + static int replicator_runtime_suspend(struct device *dev) + { +@@ -175,11 +161,11 @@ static const struct of_device_id replicator_match[] = { + + static struct platform_driver replicator_driver = { + .probe = replicator_probe, +- .remove = replicator_remove, + .driver = { + .name = "coresight-replicator", + .of_match_table = replicator_match, + .pm = &replicator_dev_pm_ops, ++ .suppress_bind_attrs = true, + }, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c +index 62f9d7372e3a..c4fa70ed14ce 100644 +--- a/drivers/hwtracing/coresight/coresight-tmc.c ++++ b/drivers/hwtracing/coresight/coresight-tmc.c +@@ -770,19 +770,6 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) + return ret; + } + +-static int tmc_remove(struct amba_device *adev) +-{ +- struct tmc_drvdata *drvdata = amba_get_drvdata(adev); +- +- misc_deregister(&drvdata->miscdev); +- coresight_unregister(drvdata->csdev); +- if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) +- dma_free_coherent(drvdata->dev, drvdata->size, +- &drvdata->paddr, GFP_KERNEL); +- +- return 0; +-} +- + static struct amba_id tmc_ids[] = { + { + .id = 0x0003b961, +@@ -795,9 +782,9 @@ static struct amba_driver tmc_driver = { + .drv = { + .name = "coresight-tmc", + .owner = THIS_MODULE, ++ .suppress_bind_attrs = true, + }, + .probe = tmc_probe, +- .remove = tmc_remove, + .id_table = tmc_ids, + }; + +diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c +index fe3a2b19a5db..105c192eb2c1 100644 +--- a/drivers/hwtracing/coresight/coresight-tpiu.c ++++ b/drivers/hwtracing/coresight/coresight-tpiu.c +@@ -180,14 +180,6 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) + return 0; + } + +-static int tpiu_remove(struct amba_device *adev) +-{ +- struct tpiu_drvdata *drvdata = amba_get_drvdata(adev); +- +- coresight_unregister(drvdata->csdev); +- return 0; +-} +- + #ifdef CONFIG_PM + static int tpiu_runtime_suspend(struct device *dev) + { +@@ -231,9 +223,9 @@ static struct amba_driver tpiu_driver = { + .name = "coresight-tpiu", + .owner = THIS_MODULE, + .pm = &tpiu_dev_pm_ops, ++ .suppress_bind_attrs = true, + }, + .probe = tpiu_probe, +- .remove = tpiu_remove, + .id_table = tpiu_ids, + }; + +-- +2.19.1 + diff --git a/queue-4.4/series b/queue-4.4/series index 83b467a49c4..8d55cb065fb 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -126,3 +126,6 @@ x86-smp-enforce-config_hotplug_cpu-when-smp-y.patch kvm-reject-device-ioctls-from-processes-other-than-the-vm-s-creator.patch xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch revert-usb-core-only-clean-up-what-we-allocated.patch +arm64-support-keyctl-system-call-in-32-bit-mode.patch +coresight-removing-bind-unbind-options-from-sysfs.patch +stm-class-hide-stm-specific-options-if-stm-is-disabl.patch diff --git a/queue-4.4/stm-class-hide-stm-specific-options-if-stm-is-disabl.patch b/queue-4.4/stm-class-hide-stm-specific-options-if-stm-is-disabl.patch new file mode 100644 index 00000000000..3d731e37ffd --- /dev/null +++ b/queue-4.4/stm-class-hide-stm-specific-options-if-stm-is-disabl.patch @@ -0,0 +1,42 @@ +From 0c086e86701ea4f0edbd199c3fdac6123f695a85 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Tue, 22 Dec 2015 17:25:15 +0200 +Subject: stm class: Hide STM-specific options if STM is disabled + +[ Upstream commit 4a2e2b19f96acfc037a9773c7729d133ce1e7e3b ] + +If STM=n, it doesn't make sense to ask about STM_DUMMY and +STM_SOURCE_CONSOLE support, which are not even built when enabled +anyway. Hence hide these options if STM=n. + +Reported-by: Linus Torvalds +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Alexander Shishkin +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/hwtracing/stm/Kconfig | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/hwtracing/stm/Kconfig b/drivers/hwtracing/stm/Kconfig +index e7a348807f0c..e0ac75395526 100644 +--- a/drivers/hwtracing/stm/Kconfig ++++ b/drivers/hwtracing/stm/Kconfig +@@ -9,6 +9,8 @@ config STM + + Say Y here to enable System Trace Module device support. + ++if STM ++ + config STM_DUMMY + tristate "Dummy STM driver" + help +@@ -25,3 +27,5 @@ config STM_SOURCE_CONSOLE + + If you want to send kernel console messages over STM devices, + say Y. ++ ++endif +-- +2.19.1 +