From: Guo Zihao <guozh23@xiaopeng.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Markus Armbruster <armbru@redhat.com>,
Thomas Gleixner <tglx@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] Input: xen-kbdfront - bound the backend-supplied keycode
Date: Fri, 06 Nov 2026 14:32:36 +0800 [thread overview]
Message-ID: <179394675606.2415331.18232448967087865312@xiaopeng.com> (raw)
In-Reply-To: <au1xwKh4LVxHyUMW@google.com>
Hi Dmitry,
The threat model is a compromised backend: the xenbus device model gives
the backend write access to the shared ring page for the entire lifetime
of the frontend, and the guest has no way to distinguish well-formed
input from forged input once the peer on the other end is malicious.
Two scenarios where that peer is not fully trusted:
- Multi-tenant hosts. The backend lives in dom0, so a kernel compromise
of the host should not immediately translate into kernel memory
corruption inside the guests. Frontends are the last line of defence
there: every frontend that consumes ring data without validation hands
the attacker a structured memory-corruption primitive in the guest,
which is a meaningful step beyond "the host can already do anything".
- Driver domain disaggregation. Backends can also run in unprivileged
driver domains, where compromising the backend is much cheaper than
compromising dom0.
This is the same model under which mainline keeps accepting frontend
hardening, for example:
9b4cf60c6b73 ("9p/xen: validate the response size from the backend")
d33846c8dcc0 ("xen/pvcalls: bound backend response req_id before indexing rsp[]")
992df081bc88 ("xen/scsifront: check for a NULL shadow entry on a backend response")
808e530654a5 ("misc: nsm: bound the device-reported response length")
e3046eeada29 ("hwrng: virtio: clamp device-reported used.len at copy_data()")
and the READ_ONCE() snapshot in v2 follows the same convention as
8135cf8b0927 ("xen/pciback: Save xen_pci_op commands before processing it").
The keycode here is the kbdfront instance of that pattern: a plain u32
read from the shared page and used as a bitmap index, with nothing
between the fetch and the use.
Thanks,
Guo Zihao
prev parent reply other threads:[~2026-11-06 6:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 1:49 [PATCH] " Guo Zihao
2026-11-06 2:02 ` [PATCH v2] " Guo Zihao
2026-11-06 6:21 ` Dmitry Torokhov
2026-11-06 6:32 ` Guo Zihao [this message]
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=179394675606.2415331.18232448967087865312@xiaopeng.com \
--to=guozh23@xiaopeng.com \
--cc=armbru@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.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
all inboxes | Powered by JetHome®