lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] arch/m68k/kernel/sys_m68k: Add missing mmap_read_lock() to sys_cacheflush()
Date
Forgot the fixes line.

* Liam Howlett <liam.howlett@oracle.com> [210407 16:00]:
> When the superuser flushes the entire cache, the mmap_read_lock() is not
> taken, but mmap_read_unlock() is called. Add the missing
> mmap_read_lock() call.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
> ---
> arch/m68k/kernel/sys_m68k.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
> index 1c235d8f53f3..f55bdcb8e4f1 100644
> --- a/arch/m68k/kernel/sys_m68k.c
> +++ b/arch/m68k/kernel/sys_m68k.c
> @@ -388,6 +388,8 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
> ret = -EPERM;
> if (!capable(CAP_SYS_ADMIN))
> goto out;
> +
> + mmap_read_lock(current->mm);
> } else {
> struct vm_area_struct *vma;
>
> --
> 2.30.0
From aeee71b15f54426f02f41a4408afbd0b5acab7ec Mon Sep 17 00:00:00 2001
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
Date: Wed, 7 Apr 2021 11:39:06 -0400
Subject: [PATCH] arch/m68k/kernel/sys_m68k: Add missing mmap_read_lock() to
sys_cacheflush()

When the superuser flushes the entire cache, the mmap_read_lock() is not
taken, but mmap_read_unlock() is called. Add the missing
mmap_read_lock() call.

Fixes: cd2567b6850b (m68k: call find_vma with the mmap_sem held in
sys_cacheflush())
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
arch/m68k/kernel/sys_m68k.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 1c235d8f53f3..f55bdcb8e4f1 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -388,6 +388,8 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
ret = -EPERM;
if (!capable(CAP_SYS_ADMIN))
goto out;
+
+ mmap_read_lock(current->mm);
} else {
struct vm_area_struct *vma;

--
2.30.0
\
 
 \ /
  Last update: 2021-04-08 18:35    [W:0.054 / U:2.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site