diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-11-25 20:17:18 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 20:03:33 +0100 |
commit | 1dde3fde62b7cdb4bac37f89b29e079bf2a9b004 (patch) | |
tree | bee091d8532903962f1d111359124eb279df96db /rust/kernel/init.rs | |
parent | 35e8f9125d3c7c8aef5fa74ad183674892954936 (diff) |
mm: open-code PageTail in folio_flags() and const_folio_flags()
commit 4de22b2a6a7477d84d9a01eb6b62a9117309d722 upstream.
It is unsafe to call PageTail() in dump_page() as page_is_fake_head() will
almost certainly return true when called on a head page that is copied to
the stack. That will cause the VM_BUG_ON_PGFLAGS() in const_folio_flags()
to trigger when it shouldn't. Fortunately, we don't need to call
PageTail() here; it's fine to have a pointer to a virtual alias of the
page's flag word rather than the real page's flag word.
Link: https://lkml.kernel.org/r/20241125201721.2963278-1-willy@infradead.org
Fixes: fae7d834c43c ("mm: add __dump_folio()")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Kees Cook <kees@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/kernel/init.rs')
0 files changed, 0 insertions, 0 deletions