[folded-merged] m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2
has been removed from the -mm tree.  Its filename was
     m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2.patch

This patch was dropped because it was folded into m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush.patch

------------------------------------------------------
From: Davidlohr Bueso <davidlohr@xxxxxx>
Subject: m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2

So I wasn't sure if we *really* required to serialize the entire address
space for this operation. However, looking at other archs, sh seems to
do exactly that, so I guess, at least for safety, we should hold the
lock until we exit the function. I guess taking it as a reader enables
us to guarantee it won't be removed underneath us. So here's v2.

Signed-off-by: Davidlohr Bueso <davidlohr@xxxxxx>
Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/m68k/kernel/sys_m68k.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff -puN arch/m68k/kernel/sys_m68k.c~m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2 arch/m68k/kernel/sys_m68k.c
--- a/arch/m68k/kernel/sys_m68k.c~m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush-v2
+++ a/arch/m68k/kernel/sys_m68k.c
@@ -389,7 +389,6 @@ sys_cacheflush (unsigned long addr, int
 			goto out;
 	} else {
 		struct vm_area_struct *vma;
-		bool invalid;
 
 		/* Check for overflow.  */
 		if (addr + len < addr)
@@ -402,10 +401,8 @@ sys_cacheflush (unsigned long addr, int
 		ret = -EINVAL;
 		down_read(&current->mm->mmap_sem);
 		vma = find_vma(current->mm, addr);
-		invalid = !vma || addr < vma->vm_start || addr + len > vma->vm_end;
-		up_read(&current->mm->mmap_sem);
-		if (invalid)
-			goto out;
+		if (!vma || addr < vma->vm_start || addr + len > vma->vm_end)
+			goto out_unlock;
 	}
 
 	if (CPU_IS_020_OR_030) {
@@ -435,7 +432,7 @@ sys_cacheflush (unsigned long addr, int
 			__asm__ __volatile__ ("movec %0, %%cacr" : : "r" (cacr));
 		}
 		ret = 0;
-		goto out;
+		goto out_unlock;
 	} else {
 	    /*
 	     * 040 or 060: don't blindly trust 'scope', someone could
@@ -452,6 +449,8 @@ sys_cacheflush (unsigned long addr, int
 		ret = cache_flush_060 (addr, scope, cache, len);
 	    }
 	}
+out_unlock:
+	up_read(&current->mm->mmap_sem);
 out:
 	return ret;
 }
_

Patches currently in -mm which might be from davidlohr@xxxxxx are

m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux