From: Jiri Pirko <jiri@resnulli.us>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
michal.michalik@intel.com, milena.olech@intel.com,
pabeni@redhat.com, kuba@kernel.org,
Jan Glaza <jan.glaza@intel.com>
Subject: Re: [PATCH net v2 1/4] dpll: fix pin dump crash after module unbind
Date: Thu, 4 Jan 2024 16:08:32 +0100 [thread overview]
Message-ID: <ZZbJ8I99ia4kbBL3@nanopsycho> (raw)
In-Reply-To: <20240104111132.42730-2-arkadiusz.kubalewski@intel.com>
Thu, Jan 04, 2024 at 12:11:29PM CET, arkadiusz.kubalewski@intel.com wrote:
>Disallow dump of unregistered parent pins, it is possible when parent
>pin and dpll device registerer kernel module instance unbinds, and
>other kernel module instances of the same dpll device have pins
>registered with the parent pin. The user can invoke a pin-dump but as
>the parent was unregistered, those shall not be accessed by the
>userspace, prevent that by checking if parent pin is still registered.
>
>Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
>Reviewed-by: Jan Glaza <jan.glaza@intel.com>
>Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
>---
> drivers/dpll/dpll_netlink.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
>index ce7cf736f020..b53478374a38 100644
>--- a/drivers/dpll/dpll_netlink.c
>+++ b/drivers/dpll/dpll_netlink.c
>@@ -328,6 +328,8 @@ dpll_msg_add_pin_parents(struct sk_buff *msg, struct dpll_pin *pin,
> void *parent_priv;
>
> ppin = ref->pin;
>+ if (!xa_get_mark(&dpll_pin_xa, ppin->id, DPLL_REGISTERED))
>+ continue;
If you make sure to hide the pin properly with the last patch, you don't
need this one. Drop it.
> parent_priv = dpll_pin_on_dpll_priv(dpll_ref->dpll, ppin);
> ret = ops->state_on_pin_get(pin,
> dpll_pin_on_pin_priv(ppin, pin),
>--
>2.38.1
>
next prev parent reply other threads:[~2024-01-04 15:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 11:11 [PATCH net v2 0/4] dpll: fix unordered unbind/bind registerer issues Arkadiusz Kubalewski
2024-01-04 11:11 ` [PATCH net v2 1/4] dpll: fix pin dump crash after module unbind Arkadiusz Kubalewski
2024-01-04 15:08 ` Jiri Pirko [this message]
2024-01-11 9:06 ` Kubalewski, Arkadiusz
2024-01-04 11:11 ` [PATCH net v2 2/4] dpll: fix pin dump crash for rebound module Arkadiusz Kubalewski
2024-01-04 15:40 ` Jiri Pirko
2024-01-11 9:07 ` Kubalewski, Arkadiusz
2024-01-04 11:11 ` [PATCH net v2 3/4] dpll: fix register pin with unregistered parent pin Arkadiusz Kubalewski
2024-01-04 14:48 ` Jiri Pirko
2024-01-11 9:06 ` Kubalewski, Arkadiusz
2024-01-04 11:11 ` [PATCH net v2 4/4] dpll: hide "zombie" pins for userspace Arkadiusz Kubalewski
2024-01-04 15:04 ` Jiri Pirko
2024-01-11 9:16 ` Kubalewski, Arkadiusz
2024-01-04 15:07 ` Jiri Pirko
2024-01-11 9:16 ` Kubalewski, Arkadiusz
2024-01-04 15:09 ` Jiri Pirko
2024-01-11 9:16 ` Kubalewski, Arkadiusz
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=ZZbJ8I99ia4kbBL3@nanopsycho \
--to=jiri@resnulli.us \
--cc=arkadiusz.kubalewski@intel.com \
--cc=jan.glaza@intel.com \
--cc=kuba@kernel.org \
--cc=michal.michalik@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/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).