From: Greg Kroah-Hartman Date: Sun, 16 Oct 2022 09:32:01 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v5.4.219~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8e63232da94bffd7fb139bc4c344bd1e5349cdb;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch riscv-allow-prot_write-only-mmap.patch --- diff --git a/queue-4.19/parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch b/queue-4.19/parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch new file mode 100644 index 00000000000..5868d3af258 --- /dev/null +++ b/queue-4.19/parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch @@ -0,0 +1,31 @@ +From aca7c13d3bee81a968337a5515411409ae9d095d Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 14 Oct 2022 10:13:55 +0200 +Subject: parisc: fbdev/stifb: Align graphics memory size to 4MB + +From: Helge Deller + +commit aca7c13d3bee81a968337a5515411409ae9d095d upstream. + +Independend of the current graphics resolution, adjust the reported +graphics card memory size to the next 4MB boundary. +This fixes the fbtest program which expects a naturally aligned size. + +Signed-off-by: Helge Deller +Cc: +Signed-off-by: Greg Kroah-Hartman +--- + drivers/video/fbdev/stifb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/video/fbdev/stifb.c ++++ b/drivers/video/fbdev/stifb.c +@@ -1257,7 +1257,7 @@ static int __init stifb_init_fb(struct s + + /* limit fbsize to max visible screen size */ + if (fix->smem_len > yres*fix->line_length) +- fix->smem_len = yres*fix->line_length; ++ fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024); + + fix->accel = FB_ACCEL_NONE; + diff --git a/queue-4.19/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch b/queue-4.19/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch index afa73f774af..55d6e1ad772 100644 --- a/queue-4.19/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch +++ b/queue-4.19/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch @@ -13,14 +13,12 @@ now. Reported-by: Saeed Mirzamohammadi Signed-off-by: Sasha Levin --- - fs/splice.c | 10 ++++++---- + fs/splice.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -diff --git a/fs/splice.c b/fs/splice.c -index ef1604e307f1..fd28c7da3c83 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -899,15 +899,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, +@@ -899,15 +899,17 @@ ssize_t splice_direct_to_actor(struct fi { struct pipe_inode_info *pipe; long ret, bytes; @@ -42,6 +40,3 @@ index ef1604e307f1..fd28c7da3c83 100644 return -EINVAL; /* --- -2.35.1 - diff --git a/queue-4.19/riscv-allow-prot_write-only-mmap.patch b/queue-4.19/riscv-allow-prot_write-only-mmap.patch new file mode 100644 index 00000000000..881e0ebebee --- /dev/null +++ b/queue-4.19/riscv-allow-prot_write-only-mmap.patch @@ -0,0 +1,46 @@ +From 9e2e6042a7ec6504fe8e366717afa2f40cf16488 Mon Sep 17 00:00:00 2001 +From: Andrew Bresticker +Date: Thu, 15 Sep 2022 15:37:02 -0400 +Subject: riscv: Allow PROT_WRITE-only mmap() + +From: Andrew Bresticker + +commit 9e2e6042a7ec6504fe8e366717afa2f40cf16488 upstream. + +Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is +invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout +PROT_READ with the justification that a write-only PTE is considered a +reserved PTE permission bit pattern in the privileged spec. This check +is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is +inconsistent with other architectures that don't support write-only PTEs, +creating a potential software portability issue. Just remove the check +altogether and let PROT_WRITE imply PROT_READ as is the case on other +architectures. + +Note that this also allows PROT_WRITE|PROT_EXEC mappings which were +disallowed prior to the aforementioned commit; PROT_READ is implied in +such mappings as well. + +Fixes: 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") +Reviewed-by: Atish Patra +Signed-off-by: Andrew Bresticker +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220915193702.2201018-3-abrestic@rivosinc.com/ +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/sys_riscv.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/riscv/kernel/sys_riscv.c ++++ b/arch/riscv/kernel/sys_riscv.c +@@ -26,9 +26,6 @@ static long riscv_sys_mmap(unsigned long + if (unlikely(offset & (~PAGE_MASK >> page_shift_offset))) + return -EINVAL; + +- if (unlikely((prot & PROT_WRITE) && !(prot & PROT_READ))) +- return -EINVAL; +- + return ksys_mmap_pgoff(addr, len, prot, flags, fd, + offset >> (PAGE_SHIFT - page_shift_offset)); + } diff --git a/queue-4.19/series b/queue-4.19/series index 36799fbe82f..af6e4ce5525 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -47,3 +47,5 @@ hid-multitouch-add-memory-barriers.patch quota-check-next-prev-free-block-number-after-reading-from-quota-file.patch regulator-qcom_rpm-fix-circular-deferral-regression.patch revert-fs-check-fmode_lseek-to-control-internal-pipe.patch +parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch +riscv-allow-prot_write-only-mmap.patch