]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2022 09:32:01 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2022 09:32:01 +0000 (11:32 +0200)
added patches:
parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch
riscv-allow-prot_write-only-mmap.patch

queue-4.19/parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch [new file with mode: 0644]
queue-4.19/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch
queue-4.19/riscv-allow-prot_write-only-mmap.patch [new file with mode: 0644]
queue-4.19/series

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 (file)
index 0000000..5868d3a
--- /dev/null
@@ -0,0 +1,31 @@
+From aca7c13d3bee81a968337a5515411409ae9d095d Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Fri, 14 Oct 2022 10:13:55 +0200
+Subject: parisc: fbdev/stifb: Align graphics memory size to 4MB
+
+From: Helge Deller <deller@gmx.de>
+
+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 <deller@gmx.de>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
index afa73f774afaeea47dbb3d3585b09b9854060809..55d6e1ad772de338c4fe50d28758da68605c9669 100644 (file)
@@ -13,14 +13,12 @@ now.
 Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- 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 (file)
index 0000000..881e0eb
--- /dev/null
@@ -0,0 +1,46 @@
+From 9e2e6042a7ec6504fe8e366717afa2f40cf16488 Mon Sep 17 00:00:00 2001
+From: Andrew Bresticker <abrestic@rivosinc.com>
+Date: Thu, 15 Sep 2022 15:37:02 -0400
+Subject: riscv: Allow PROT_WRITE-only mmap()
+
+From: Andrew Bresticker <abrestic@rivosinc.com>
+
+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 <atishp@rivosinc.com>
+Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20220915193702.2201018-3-abrestic@rivosinc.com/
+Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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));
+ }
index 36799fbe82f4a399cce0b18c5766903111378b01..af6e4ce5525dbf240578946f2de3ae98a81ac89e 100644 (file)
@@ -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