mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kenneth Kabogo <kennethkabogo2@gmail.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: Dmitry Baryshkov <lumag@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: qcom_pd_mapper: SERVREG_LOC request handlers do not validate the QMI sender
Date: Thu, 10 Sep 2026 21:33:04 +0300	[thread overview]
Message-ID: <20260910183304.76926-1-kennethkabogo2@gmail.com> (raw)

Hi,

Flagging a hardening gap in the in-kernel protection-domain mapper, found
by code inspection (no proof-of-concept, and I don't have the hardware to
test on at runtime).

qcom_pdm_get_domain_list() and qcom_pdm_pfr() are the two QMI_REQUEST
handlers for the SERVREG_LOC service this driver registers. Neither
validates the sender address (struct sockaddr_qrtr *sq); it is used only
to address the response.

  - qcom_pdm_get_domain_list(): any local sender that can reach the qrtr
    socket can enumerate the registered protection-domain / service list
    for any service name.

  - qcom_pdm_pfr(): any such sender can submit a restart/crash report
    with attacker-controlled service and reason strings. The handler logs
    them via pr_warn_ratelimited() and acks QMI_RESULT_SUCCESS_V01. There
    is no check that the sender owns the domain it is reporting on, and no
    recovery action is taken, so the practical effect is an
    attacker-influenced ratelimited kernel log line.

Impact is low. On Android the qrtr socket is not reachable by untrusted
apps (SELinux neverallow on qipcrtr_socket), so this is gated to
privileged system components, and there is no memory-safety issue. But a
PFR report in particular seems like it should only be accepted from the
entity managing the domain being reported.

Two questions:

  1. Is get_domain_list intended to be an open lookup service for any
     local client, or should it be restricted? If restricted, on what
     basis?

  2. For pfr, would you take a patch that rejects reports for domains the
     sender does not provide (or checks the sender against the registered
     owner of the reported domain)?

Happy to send patches once the intended trust model is clear.

Thanks,
Kenneth Kabogo

                 reply	other threads:[~2026-09-10 18:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260910183304.76926-1-kennethkabogo2@gmail.com \
    --to=kennethkabogo2@gmail.com \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@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®