mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Huang Wei <huangwei@kylinos.cn>
To: Bertrand Jacquin <bertrand@jacquin.bzh>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Venkat Jayaraman <venkat.jayaraman@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, huangwei@kylinos.cn
Subject: Re: [PATCH] usb: typec: ucsi: Fix NULL pointer dereference in power level debugfs
Date: Mon, 12 Oct 2026 11:16:05 +0800	[thread overview]
Message-ID: <20261012031606.2858685-1-huangwei@kylinos.cn> (raw)
In-Reply-To: <20261010120357.4937-1-bertrand@jacquin.bzh>

Hi Bertrand,

I checked this over. The window is real - ucsi_register() creates the
debugfs entries right away while ucsi->connector is only assigned at
the end of ucsi_init(), so on the PPM-init-failed path those three
files stay reachable with a NULL connector.

I also grepped debugfs.c for other ucsi->connector dereferences - the
three show functions the patch guards are the only ones (ucsi_resp
and the command interface go through ucsi->debugfs), so the fix is
complete.

One thing I'd note in favour of guarding rather than moving
ucsi_debugfs_register() after connector assignment: the command and
response files are exactly what you want available when the PPM is
misbehaving, so keeping the early registration and just making the
power-level reads fail cleanly looks like the better shape to me.

Reviewed-by: Huang Wei <huangwei@kylinos.cn>

Thanks,
Huang Wei

  reply	other threads:[~2026-10-12  3:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 12:03 Bertrand Jacquin
2026-10-12  3:16 ` Huang Wei [this message]
2026-10-26 11:40 ` Heikki Krogerus

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=20261012031606.2858685-1-huangwei@kylinos.cn \
    --to=huangwei@kylinos.cn \
    --cc=bertrand@jacquin.bzh \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=venkat.jayaraman@intel.com \
    /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®