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]
Date:	Thu, 16 Jul 2015 16:47:03 +0800
From:	Baoquan He <bhe@...hat.com>
To:	linux-kernel@...r.kernel.org, ncroxon@...hat.com,
	dyoung@...hat.com, mhuang@...hat.com
Cc:	Baoquan He <bhe@...hat.com>
Subject: [RHEL6.8 Patch 05/19] include/linux/mm.h: add PAGE_ALIGNED() helper

Resolves: bz1097904
https://bugzilla.redhat.com/show_bug.cgi?id=1097904

This is back ported from upstream directly.

commit 0fa73b86ef0797ca4fde5334117ca0b330f08030
Author: Andrew Morton <akpm@...ux-foundation.org>
Date:   Wed Jul 3 15:02:11 2013 -0700

    include/linux/mm.h: add PAGE_ALIGNED() helper

    To test whether an address is aligned to PAGE_SIZE.

    Cc: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
    Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
    Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>

Signed-off-by: Baoquan He <bhe@...hat.com>
---
 include/linux/mm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 21c2c99..8d490e0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -55,6 +55,9 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
 
+/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */
+#define PAGE_ALIGNED(addr)	IS_ALIGNED((unsigned long)addr, PAGE_SIZE)
+
 /*
  * Linux kernel virtual memory manager primitives.
  * The idea being to have a "virtual" mm in the same way
-- 
2.1.0

--
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