[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR11MB465716178DF6F16D4F1DFFE59B682@DM6PR11MB4657.namprd11.prod.outlook.com>
Date: Thu, 11 Jan 2024 09:06:44 +0000
From: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@...el.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"vadim.fedorenko@...ux.dev" <vadim.fedorenko@...ux.dev>, "Olech, Milena"
<milena.olech@...el.com>, "pabeni@...hat.com" <pabeni@...hat.com>,
"kuba@...nel.org" <kuba@...nel.org>, "Glaza, Jan" <jan.glaza@...el.com>
Subject: RE: [PATCH net v2 1/4] dpll: fix pin dump crash after module unbind
>From: Jiri Pirko <jiri@...nulli.us>
>Sent: Thursday, January 4, 2024 4:09 PM
>
>Thu, Jan 04, 2024 at 12:11:29PM CET, arkadiusz.kubalewski@...el.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@...el.com>
>>Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.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.
>
Makes sense, will do.
Thank you!
Arkadiusz
>
>> 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
>>
Powered by blists - more mailing lists