From: Simon Horman <horms@kernel.org>
To: Kamal Heib <kheib@redhat.com>
Cc: netdev@vger.kernel.org, Veerasenareddy Burru <vburru@marvell.com>,
Sathesh Edara <sedara@marvell.com>,
Shinas Rasheed <srasheed@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Subject: Re: [PATCH net v2] octeon_ep: Validate the VF ID
Date: Tue, 9 Sep 2025 19:51:24 +0100 [thread overview]
Message-ID: <20250909185124.GD20205@horms.kernel.org> (raw)
In-Reply-To: <20250909131020.1397422-1-kheib@redhat.com>
On Tue, Sep 09, 2025 at 09:10:20AM -0400, Kamal Heib wrote:
> Add a helper to validate the VF ID and use it in the VF ndo ops to
> prevent accessing out-of-range entries.
>
> Without this check, users can run commands such as:
>
> # ip link show dev enp135s0
> 2: enp135s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
> link/ether 00:00:00:01:01:00 brd ff:ff:ff:ff:ff:ff
> vf 0 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
> vf 1 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
> # ip link set dev enp135s0 vf 4 mac 00:00:00:00:00:14
> # echo $?
> 0
>
> even though VF 4 does not exist, which results in silent success instead
> of returning an error.
>
> Fixes: 8a241ef9b9b8 ("octeon_ep: add ndo ops for VFs in PF driver")
> Signed-off-by: Kamal Heib <kheib@redhat.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> ---
> v2: Address the comments from Michal.
Thanks Kamal,
This looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
For future reference: please allow 24h to elapse between patch revisions.
next prev parent reply other threads:[~2025-09-09 18:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 13:10 [PATCH net v2] octeon_ep: Validate the VF ID Kamal Heib
2025-09-09 18:51 ` Simon Horman [this message]
2025-09-11 2:26 ` Jakub Kicinski
2025-09-11 16:57 ` Kamal Heib
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=20250909185124.GD20205@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=kheib@redhat.com \
--cc=kuba@kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sedara@marvell.com \
--cc=srasheed@marvell.com \
--cc=vburru@marvell.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;
as well as URLs for NNTP newsgroup(s).