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-next>] [day] [month] [year] [list]
Message-Id: <1553689672-28343-1-git-send-email-anshuman.khandual@arm.com>
Date:   Wed, 27 Mar 2019 17:57:52 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     linux-kernel@...r.kernel.org
Cc:     linux-mm@...ck.org, hannes@...xchg.org, david@...hat.com,
        vbabka@...e.cz, mhocko@...e.com, willy@...radead.org,
        akpm@...ux-foundation.org
Subject: [PATCH] mm/page-flags: Check enforce parameter in PF_ONLY_HEAD()

Just check for enforce parameter in PF_ONLY_HEAD() wrapper before calling
VM_BUG_ON_PGFLAGS() for tail pages.

Fixes: 62906027091f ("mm: add PageWaiters indicating tasks are waiting for a page bit")
Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
---
 include/linux/page-flags.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 9f8712a4b1a5..82539e287bc6 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -229,7 +229,7 @@ static inline void page_init_poison(struct page *page, size_t size)
 #define PF_ANY(page, enforce)	PF_POISONED_CHECK(page)
 #define PF_HEAD(page, enforce)	PF_POISONED_CHECK(compound_head(page))
 #define PF_ONLY_HEAD(page, enforce) ({					\
-		VM_BUG_ON_PGFLAGS(PageTail(page), page);		\
+		VM_BUG_ON_PGFLAGS(enforce && PageTail(page), page);	\
 		PF_POISONED_CHECK(page); })
 #define PF_NO_TAIL(page, enforce) ({					\
 		VM_BUG_ON_PGFLAGS(enforce && PageTail(page), page);	\
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ