From: Greg Kroah-Hartman Date: Tue, 15 Sep 2020 07:57:08 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.19.146~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75c70d9d6ec8064e6181790ee32ec85a889e95e2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: drm-msm-disable-preemption-on-all-5xx-targets.patch drm-tve200-stabilize-enable-disable.patch rbd-require-global-cap_sys_admin-for-mapping-and-unmapping.patch --- diff --git a/queue-4.19/drm-msm-disable-preemption-on-all-5xx-targets.patch b/queue-4.19/drm-msm-disable-preemption-on-all-5xx-targets.patch new file mode 100644 index 00000000000..50834af5038 --- /dev/null +++ b/queue-4.19/drm-msm-disable-preemption-on-all-5xx-targets.patch @@ -0,0 +1,33 @@ +From 7b3f3948c8b7053d771acc9f79810cc410f5e2e0 Mon Sep 17 00:00:00 2001 +From: Jordan Crouse +Date: Thu, 3 Sep 2020 20:03:12 -0600 +Subject: drm/msm: Disable preemption on all 5xx targets + +From: Jordan Crouse + +commit 7b3f3948c8b7053d771acc9f79810cc410f5e2e0 upstream. + +Temporarily disable preemption on a5xx targets pending some improvements +to protect the RPTR shadow from being corrupted. + +Cc: stable@vger.kernel.org +Signed-off-by: Jordan Crouse +Signed-off-by: Rob Clark +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c ++++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +@@ -1518,7 +1518,8 @@ struct msm_gpu *a5xx_gpu_init(struct drm + + check_speed_bin(&pdev->dev); + +- ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4); ++ /* Restricting nr_rings to 1 to temporarily disable preemption */ ++ ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 1); + if (ret) { + a5xx_destroy(&(a5xx_gpu->base.base)); + return ERR_PTR(ret); diff --git a/queue-4.19/drm-tve200-stabilize-enable-disable.patch b/queue-4.19/drm-tve200-stabilize-enable-disable.patch new file mode 100644 index 00000000000..98e1c2321f0 --- /dev/null +++ b/queue-4.19/drm-tve200-stabilize-enable-disable.patch @@ -0,0 +1,90 @@ +From f71800228dc74711c3df43854ce7089562a3bc2d Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Thu, 20 Aug 2020 22:31:44 +0200 +Subject: drm/tve200: Stabilize enable/disable + +From: Linus Walleij + +commit f71800228dc74711c3df43854ce7089562a3bc2d upstream. + +The TVE200 will occasionally print a bunch of lost interrupts +and similar dmesg messages, sometimes during boot and sometimes +after disabling and coming back to enablement. This is probably +because the hardware is left in an unknown state by the boot +loader that displays a logo. + +This can be fixed by bringing the controller into a known state +by resetting the controller while enabling it. We retry reset 5 +times like the vendor driver does. We also put the controller +into reset before de-clocking it and clear all interrupts before +enabling the vblank IRQ. + +This makes the video enable/disable/enable cycle rock solid +on the D-Link DIR-685. Tested extensively. + +Signed-off-by: Linus Walleij +Acked-by: Daniel Vetter +Cc: stable@vger.kernel.org +Link: https://patchwork.freedesktop.org/patch/msgid/20200820203144.271081-1-linus.walleij@linaro.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/tve200/tve200_display.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/tve200/tve200_display.c ++++ b/drivers/gpu/drm/tve200/tve200_display.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -132,9 +133,25 @@ static void tve200_display_enable(struct + struct drm_connector *connector = priv->connector; + u32 format = fb->format->format; + u32 ctrl1 = 0; ++ int retries; + + clk_prepare_enable(priv->clk); + ++ /* Reset the TVE200 and wait for it to come back online */ ++ writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); ++ for (retries = 0; retries < 5; retries++) { ++ usleep_range(30000, 50000); ++ if (readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) ++ continue; ++ else ++ break; ++ } ++ if (retries == 5 && ++ readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) { ++ dev_err(drm->dev, "can't get hardware out of reset\n"); ++ return; ++ } ++ + /* Function 1 */ + ctrl1 |= TVE200_CTRL_CSMODE; + /* Interlace mode for CCIR656: parameterize? */ +@@ -231,8 +248,9 @@ static void tve200_display_disable(struc + + drm_crtc_vblank_off(crtc); + +- /* Disable and Power Down */ ++ /* Disable put into reset and Power Down */ + writel(0, priv->regs + TVE200_CTRL); ++ writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); + + clk_disable_unprepare(priv->clk); + } +@@ -280,6 +298,8 @@ static int tve200_display_enable_vblank( + struct drm_device *drm = crtc->dev; + struct tve200_drm_dev_private *priv = drm->dev_private; + ++ /* Clear any IRQs and enable */ ++ writel(0xFF, priv->regs + TVE200_INT_CLR); + writel(TVE200_INT_V_STATUS, priv->regs + TVE200_INT_EN); + return 0; + } diff --git a/queue-4.19/rbd-require-global-cap_sys_admin-for-mapping-and-unmapping.patch b/queue-4.19/rbd-require-global-cap_sys_admin-for-mapping-and-unmapping.patch new file mode 100644 index 00000000000..a9f48c2cd8f --- /dev/null +++ b/queue-4.19/rbd-require-global-cap_sys_admin-for-mapping-and-unmapping.patch @@ -0,0 +1,79 @@ +From f44d04e696feaf13d192d942c4f14ad2e117065a Mon Sep 17 00:00:00 2001 +From: Ilya Dryomov +Date: Thu, 3 Sep 2020 13:24:11 +0200 +Subject: rbd: require global CAP_SYS_ADMIN for mapping and unmapping + +From: Ilya Dryomov + +commit f44d04e696feaf13d192d942c4f14ad2e117065a upstream. + +It turns out that currently we rely only on sysfs attribute +permissions: + + $ ll /sys/bus/rbd/{add*,remove*} + --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add + --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major + --w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/remove + --w------- 1 root root 4096 Sep 3 20:38 /sys/bus/rbd/remove_single_major + +This means that images can be mapped and unmapped (i.e. block devices +can be created and deleted) by a UID 0 process even after it drops all +privileges or by any process with CAP_DAC_OVERRIDE in its user namespace +as long as UID 0 is mapped into that user namespace. + +Be consistent with other virtual block devices (loop, nbd, dm, md, etc) +and require CAP_SYS_ADMIN in the initial user namespace for mapping and +unmapping, and also for dumping the configuration string and refreshing +the image header. + +Cc: stable@vger.kernel.org +Signed-off-by: Ilya Dryomov +Reviewed-by: Jeff Layton +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/rbd.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -4124,6 +4124,9 @@ static ssize_t rbd_config_info_show(stru + { + struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); + ++ if (!capable(CAP_SYS_ADMIN)) ++ return -EPERM; ++ + return sprintf(buf, "%s\n", rbd_dev->config_info); + } + +@@ -4235,6 +4238,9 @@ static ssize_t rbd_image_refresh(struct + struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); + int ret; + ++ if (!capable(CAP_SYS_ADMIN)) ++ return -EPERM; ++ + ret = rbd_dev_refresh(rbd_dev); + if (ret) + return ret; +@@ -5846,6 +5852,9 @@ static ssize_t do_rbd_add(struct bus_typ + struct rbd_client *rbdc; + int rc; + ++ if (!capable(CAP_SYS_ADMIN)) ++ return -EPERM; ++ + if (!try_module_get(THIS_MODULE)) + return -ENODEV; + +@@ -5995,6 +6004,9 @@ static ssize_t do_rbd_remove(struct bus_ + bool force = false; + int ret; + ++ if (!capable(CAP_SYS_ADMIN)) ++ return -EPERM; ++ + dev_id = -1; + opt_buf[0] = '\0'; + sscanf(buf, "%d %5s", &dev_id, opt_buf); diff --git a/queue-4.19/series b/queue-4.19/series index 94c45061f93..39ae52945b8 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -58,3 +58,6 @@ btrfs-fix-wrong-address-when-faulting-in-pages-in-the-search-ioctl.patch regulator-push-allocation-in-set_consumer_device_supply-out-of-lock.patch scsi-target-iscsi-fix-data-digest-calculation.patch scsi-target-iscsi-fix-hang-in-iscsit_access_np-when-getting-tpg-np_login_sem.patch +drm-tve200-stabilize-enable-disable.patch +drm-msm-disable-preemption-on-all-5xx-targets.patch +rbd-require-global-cap_sys_admin-for-mapping-and-unmapping.patch