From 03a1cd0d135c5bd6e828b94e0c3885f2453bb11e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 13 Aug 2022 14:56:28 +0200 Subject: [PATCH] 4.9-stable patches added patches: drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch parisc-fix-device-names-in-proc-iomem.patch --- ...ix-another-off-by-one-in-nvbios_addr.patch | 35 +++++++++++++++ ...arisc-fix-device-names-in-proc-iomem.patch | 45 +++++++++++++++++++ queue-4.9/series | 2 + 3 files changed, 82 insertions(+) create mode 100644 queue-4.9/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch create mode 100644 queue-4.9/parisc-fix-device-names-in-proc-iomem.patch diff --git a/queue-4.9/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch b/queue-4.9/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch new file mode 100644 index 00000000000..a3edec84b86 --- /dev/null +++ b/queue-4.9/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch @@ -0,0 +1,35 @@ +From c441d28945fb113220d48d6c86ebc0b090a2b677 Mon Sep 17 00:00:00 2001 +From: Timur Tabi +Date: Wed, 11 May 2022 11:37:16 -0500 +Subject: drm/nouveau: fix another off-by-one in nvbios_addr + +From: Timur Tabi + +commit c441d28945fb113220d48d6c86ebc0b090a2b677 upstream. + +This check determines whether a given address is part of +image 0 or image 1. Image 1 starts at offset image0_size, +so that address should be included. + +Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") +Cc: # v4.8+ +Signed-off-by: Timur Tabi +Reviewed-by: Karol Herbst +Signed-off-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 + { + u32 p = *addr; + +- if (*addr > bios->image0_size && bios->imaged_addr) { ++ if (*addr >= bios->image0_size && bios->imaged_addr) { + *addr -= bios->image0_size; + *addr += bios->imaged_addr; + } diff --git a/queue-4.9/parisc-fix-device-names-in-proc-iomem.patch b/queue-4.9/parisc-fix-device-names-in-proc-iomem.patch new file mode 100644 index 00000000000..9db261629a7 --- /dev/null +++ b/queue-4.9/parisc-fix-device-names-in-proc-iomem.patch @@ -0,0 +1,45 @@ +From cab56b51ec0e69128909cef4650e1907248d821b Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 18 Jul 2022 17:06:47 +0200 +Subject: parisc: Fix device names in /proc/iomem + +From: Helge Deller + +commit cab56b51ec0e69128909cef4650e1907248d821b upstream. + +Fix the output of /proc/iomem to show the real hardware device name +including the pa_pathname, e.g. "Merlin 160 Core Centronics [8:16:0]". +Up to now only the pa_pathname ("[8:16.0]") was shown. + +Signed-off-by: Helge Deller +Cc: # v4.9+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/drivers.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/arch/parisc/kernel/drivers.c ++++ b/arch/parisc/kernel/drivers.c +@@ -504,7 +504,6 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->id.hversion_rev = iodc_data[1] & 0x0f; + dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | + (iodc_data[5] << 8) | iodc_data[6]; +- dev->hpa.name = parisc_pathname(dev); + dev->hpa.start = hpa; + /* This is awkward. The STI spec says that gfx devices may occupy + * 32MB or 64MB. Unfortunately, we don't know how to tell whether +@@ -518,10 +517,10 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->hpa.end = hpa + 0xfff; + } + dev->hpa.flags = IORESOURCE_MEM; +- name = parisc_hardware_description(&dev->id); +- if (name) { +- strlcpy(dev->name, name, sizeof(dev->name)); +- } ++ dev->hpa.name = dev->name; ++ name = parisc_hardware_description(&dev->id) ? : "unknown"; ++ snprintf(dev->name, sizeof(dev->name), "%s [%s]", ++ name, parisc_pathname(dev)); + + /* Silently fail things like mouse ports which are subsumed within + * the keyboard controller diff --git a/queue-4.9/series b/queue-4.9/series index 64f19d4dd66..ecd6897341d 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -32,3 +32,5 @@ alsa-hda-conexant-add-quirk-for-lenovo-20149-notebook-model.patch alsa-hda-cirrus-support-for-imac-12-1-model.patch vfs-check-the-truncate-maximum-size-in-inode_newsize_ok.patch usbnet-fix-linkwatch-use-after-free-on-disconnect.patch +parisc-fix-device-names-in-proc-iomem.patch +drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch -- 2.47.3