Skip to content

Commit 2ce9804

Browse files
Nicolas PitreRussell King
authored andcommitted
[ARM] 3030/2: fix permission check in the obscur cmpxchg syscall
Patch from Nicolas Pitre Quoting RMK: |pte_write() just says that the page _may_ be writable. It doesn't say |that the MMU is programmed to allow writes. If pte_dirty() doesn't |return true, that means that the page is _not_ writable from userspace. |If you write to it from kernel mode (without using put_user) you'll |bypass the MMU read-only protection and may end up writing to a page |owned by two separate processes. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 0003ced commit 2ce9804

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/arm/kernel/traps.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
506506
if (!pmd_present(*pmd))
507507
goto bad_access;
508508
pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
509-
if (!pte_present(*pte) || !pte_write(*pte)) {
509+
if (!pte_present(*pte) || !pte_dirty(*pte)) {
510510
pte_unmap_unlock(pte, ptl);
511511
goto bad_access;
512512
}

0 commit comments

Comments
 (0)