All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Dmitriy Okunev <dokunevdmitriy@gmail.com>
Cc: Frank Rowand <frowand.list@gmail.com>,
	lvc-project@linuxtesting.org,
	Stephen Boyd <stephen.boyd@linaro.org>,
	Peter Chen <peter.chen@nxp.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: module: harden a call to request_module
Date: Wed, 16 Sep 2026 15:16:32 -0500	[thread overview]
Message-ID: <20260916201632.GA1397924-robh@kernel.org> (raw)
In-Reply-To: <20260914122425.137413-1-dokunevdmitriy@gmail.com>

On Mon, Sep 14, 2026 at 03:24:25PM +0300, Dmitriy Okunev wrote:
> In of_request_module(), the string 'str' is built from Device Tree data
> and passed directly to request_module() as a format string.  While the
> Device Tree is generally considered trusted, using externally provided
> data as a format string is fragile and can lead to unintended format
> specifier interpretation. 
> 
> Fix this by using request_module("%s", str) to treat 'str' as a plain
> string argument, not a format string.

'%' is not a legal character in DT node names. Even if someone modified 
a DT to have one, would we even get to this point. Probably unflattening 
or creating sysfs files would fail first.

Rob

      reply	other threads:[~2026-09-16 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 12:24 [PATCH] of: module: harden a call to request_module Dmitriy Okunev
2026-09-16 20:16 ` Rob Herring [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=20260916201632.GA1397924-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dokunevdmitriy@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=peter.chen@nxp.com \
    --cc=stephen.boyd@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.