archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <>
Cc: Jann Horn <>,
	Youquan Song <>,
	Andrea Arcangeli <>, Jan Kara <>,
	John Hubbard <>,
	"Kirill A . Shutemov" <>,
	Matthew Wilcox <>,
	Michal Hocko <>,
	Andrew Morton <>,
	Mike Kravetz <>
Subject: [PATCH 0/2] Fix prep_compound_gigantic_page ref count adjustment
Date: Mon, 21 Jun 2021 19:14:21 -0700	[thread overview]
Message-ID: <> (raw)

These patches address the possible race between prep_compound_gigantic_page
and __page_cache_add_speculative as described by Jann Horn in [1].

The first patch simply removes the unnecessary/obsolete helper routine
prep_compound_huge_page to make the actual fix a little simpler.

The second patch is the actual fix and has a detailed explanation in the
commit message.

This potential issue has existed for almost 10 years and I am unaware of
anyone actually hitting the race.  I did not cc stable, but would be
happy to squash the patches and send to stable if anyone thinks that is
a good idea.

I could not think of a reliable way to recreate the issue for testing.
Rather, I 'simulated errors' to exercise all the error paths.

Mike Kravetz (2):
  hugetlb: remove prep_compound_huge_page cleanup
  hugetlb: address ref count racing in prep_compound_gigantic_page

 mm/hugetlb.c    | 99 ++++++++++++++++++++++++++++++++++++-------------
 mm/page_alloc.c |  1 -
 2 files changed, 73 insertions(+), 27 deletions(-)


             reply	other threads:[~2021-06-22  2:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  2:14 Mike Kravetz [this message]
2021-06-22  2:14 ` [PATCH 1/2] hugetlb: remove prep_compound_huge_page cleanup Mike Kravetz
2021-06-22  9:09   ` [External] " Muchun Song
2021-06-22  2:14 ` [PATCH 2/2] hugetlb: address ref count racing in prep_compound_gigantic_page Mike Kravetz
2021-06-23  8:00   ` [External] " Muchun Song
2021-06-24  0:26     ` Mike Kravetz
2021-06-24  3:38       ` Muchun Song
2021-06-22  2:16 ` [PATCH 0/2] Fix prep_compound_gigantic_page ref count adjustment Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).