From: Jakub Kicinski <kuba@kernel•org>
To: Kory Maincent <kory.maincent@bootlin•com>
Cc: "David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Paolo Abeni <pabeni@redhat•com>,
Donald Hunter <donald.hunter@gmail•com>,
Oleksij Rempel <o.rempel@pengutronix•de>,
Jonathan Corbet <corbet@lwn•net>,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
Dent Project <dentproject@linuxfoundation•org>,
kernel@pengutronix•de, linux-doc@vger•kernel.org
Subject: Re: [PATCH net-next v6 5/7] net: ethtool: Add new power limit get and set features
Date: Fri, 5 Jul 2024 18:41:16 -0700 [thread overview]
Message-ID: <20240705184116.13d8235a@kernel.org> (raw)
In-Reply-To: <20240704-feature_poe_power_cap-v6-5-320003204264@bootlin.com>
On Thu, 04 Jul 2024 10:12:00 +0200 Kory Maincent wrote:
> + if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] ||
> + tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]) {
> + struct pse_control_config config = {};
> +
> + if (pse_has_podl(phydev->psec))
> + config.podl_admin_control = nla_get_u32(tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]);
> + if (pse_has_c33(phydev->psec))
> + config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);
This smells of null-deref if user only passes one of the attributes.
But the fix should probably be in ethnl_set_pse_validate() so it won't
conflict (I'm speculating that it will need to go to net).
next prev parent reply other threads:[~2024-07-06 1:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 8:11 [PATCH net-next v6 0/7] net: pse-pd: Add new PSE c33 features Kory Maincent
2024-07-04 8:11 ` [PATCH net-next v6 1/7] net: ethtool: pse-pd: Expand C33 PSE status with class, power and extended state Kory Maincent
2024-07-04 8:11 ` [PATCH net-next v6 2/7] netlink: specs: Expand the PSE netlink command with C33 new features Kory Maincent
2024-07-04 8:11 ` [PATCH net-next v6 3/7] net: pse-pd: pd692x0: Expand ethtool status message Kory Maincent
2024-07-04 8:11 ` [PATCH net-next v6 4/7] net: pse-pd: Add new power limit get and set c33 features Kory Maincent
2024-07-04 8:12 ` [PATCH net-next v6 5/7] net: ethtool: Add new power limit get and set features Kory Maincent
2024-07-06 1:41 ` Jakub Kicinski [this message]
2024-07-08 9:38 ` Kory Maincent
2024-07-08 18:33 ` Jakub Kicinski
2024-07-09 13:20 ` Kory Maincent
2024-07-04 8:12 ` [PATCH net-next v6 6/7] netlink: specs: Expand the PSE netlink command with C33 pw-limit attributes Kory Maincent
2024-07-04 8:12 ` [PATCH net-next v6 7/7] net: pse-pd: pd692x0: Enhance with new current limit and voltage read callbacks Kory Maincent
2024-07-05 13:10 ` [PATCH net-next v6 0/7] net: pse-pd: Add new PSE c33 features Kory Maincent
2024-07-06 1:50 ` patchwork-bot+netdevbpf
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=20240705184116.13d8235a@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=corbet@lwn$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dentproject@linuxfoundation$(echo .)org \
--cc=donald.hunter@gmail$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=kernel@pengutronix$(echo .)de \
--cc=kory.maincent@bootlin$(echo .)com \
--cc=linux-doc@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=o.rempel@pengutronix$(echo .)de \
--cc=pabeni@redhat$(echo .)com \
--cc=thomas.petazzoni@bootlin$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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