From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"Paul Durrant" <paul@xen.org>,
"Tamas K Lengyel" <tamas@tklengyel.com>
Subject: Re: [PATCH] x86/mm: Remove cascade damage from "fishy" ref/typecount failure
Date: Tue, 19 Jan 2021 11:34:44 +0000 [thread overview]
Message-ID: <1ffd1329-a581-0384-abea-95761c03ad81@citrix.com> (raw)
In-Reply-To: <20210119094122.23713-1-andrew.cooper3@citrix.com>
On 19/01/2021 09:41, Andrew Cooper wrote:
> This code has been copied in 3 places, but it is broken and dangerous.
>
> For all these cases, the domain destruction path will underflow the whichever
> reference failed to be taken, leading to all kinds of more fun bugs.
>
> Crashing instantly is strictly less-bad behaviour.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Paul Durrant <paul@xen.org>
> CC: Tamas K Lengyel <tamas@tklengyel.com>
>
> I'm pretty certain that underflowing the main refcount is a BUG() elsewhere.
> I'm not certain what underflowing the typecount manages to do.
Actually, they're both BUG() conditions.
The typeref BUG() is in _put_page_type(), while the main refcount is
caught in put_page_alloc_ref() for each of these examples.
I'll reword the commit message, but the code change is good.
~Andrew
next prev parent reply other threads:[~2021-01-19 11:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 9:41 [PATCH] x86/mm: Remove cascade damage from "fishy" ref/typecount failure Andrew Cooper
2021-01-19 11:34 ` Andrew Cooper [this message]
2021-01-19 12:27 ` [PATCH v2] x86/mm: Short circuit " Andrew Cooper
2021-01-19 12:45 ` Paul Durrant
2021-01-19 13:00 ` Andrew Cooper
2021-01-19 13:02 ` [PATCH v3] " Andrew Cooper
2021-01-19 13:06 ` Paul Durrant
2021-01-19 16:48 ` Jan Beulich
2021-01-19 18:09 ` Andrew Cooper
2021-01-20 8:06 ` Jan Beulich
2021-01-25 17:59 ` Andrew Cooper
2021-01-26 10:48 ` Jan Beulich
2021-01-28 14:48 ` Jan Beulich
2021-01-29 11:29 ` Jan Beulich
2021-01-29 16:17 ` Andrew Cooper
2021-01-29 16:31 ` Jan Beulich
2021-01-29 17:17 ` Andrew Cooper
2021-02-01 12:50 ` Jan Beulich
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ffd1329-a581-0384-abea-95761c03ad81@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=paul@xen.org \
--cc=roger.pau@citrix.com \
--cc=tamas@tklengyel.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).