lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120321065645.13852.83925.stgit@zurg>
Date:	Wed, 21 Mar 2012 10:56:46 +0400
From:	Konstantin Khlebnikov <khlebnikov@...nvz.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-mm@...ck.org, Guan Xuetao <gxt@...c.pku.edu.cn>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 08/16] mm/unicore32: use vm_flags_t for vma flags

The same magic like in arm: assembler code wants to test VM_EXEC,
but for big-endian we should get upper word for this.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: Guan Xuetao <gxt@...c.pku.edu.cn>
---
 arch/unicore32/kernel/asm-offsets.c |    6 +++++-
 arch/unicore32/mm/fault.c           |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/unicore32/kernel/asm-offsets.c b/arch/unicore32/kernel/asm-offsets.c
index ffcbe75..e3199b5 100644
--- a/arch/unicore32/kernel/asm-offsets.c
+++ b/arch/unicore32/kernel/asm-offsets.c
@@ -87,9 +87,13 @@ int main(void)
 	DEFINE(S_FRAME_SIZE,	sizeof(struct pt_regs));
 	BLANK();
 	DEFINE(VMA_VM_MM,	offsetof(struct vm_area_struct, vm_mm));
+#if defined(CONFIG_CPU_BIG_ENDIAN) && (NR_VMA_FLAGS > 32)
+	DEFINE(VMA_VM_FLAGS,	offsetof(struct vm_area_struct, vm_flags) + 4);
+#else
 	DEFINE(VMA_VM_FLAGS,	offsetof(struct vm_area_struct, vm_flags));
+#endif
 	BLANK();
-	DEFINE(VM_EXEC,		VM_EXEC);
+	DEFINE(VM_EXEC,		(__force unsigned int)VM_EXEC);
 	BLANK();
 	DEFINE(PAGE_SZ,		PAGE_SIZE);
 	BLANK();
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c
index 283aa4b..9137996 100644
--- a/arch/unicore32/mm/fault.c
+++ b/arch/unicore32/mm/fault.c
@@ -158,7 +158,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
  */
 static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
 {
-	unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
+	vm_flags_t mask = VM_READ | VM_WRITE | VM_EXEC;
 
 	if (!(fsr ^ 0x12))	/* write? */
 		mask = VM_WRITE;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ