From: Jakub Kicinski <kuba@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: <netdev@vger.kernel.org>, <corbet@lwn.net>,
<jesse.brandeburg@intel.com>, <anthony.l.nguyen@intel.com>,
<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<vladimir.oltean@nxp.com>, <andrew@lunn.ch>, <horms@kernel.org>,
<mkubecek@suse.cz>, <willemdebruijn.kernel@gmail.com>,
<gal@nvidia.com>, <alexander.duyck@gmail.com>,
<ecree.xilinx@gmail.com>, Jacob Keller <jacob.e.keller@intel.com>
Subject: Re: [PATCH net-next 2/2] net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm
Date: Wed, 3 Jan 2024 14:16:54 -0800 [thread overview]
Message-ID: <20240103141654.44ac19e9@kernel.org> (raw)
In-Reply-To: <34b00cfb-d1d7-4468-948b-a44591dc5923@intel.com>
On Wed, 3 Jan 2024 08:40:47 -0700 Ahmed Zaki wrote:
> On 2024-01-02 17:05, Jakub Kicinski wrote:
> > On Thu, 21 Dec 2023 11:42:35 -0700 Ahmed Zaki wrote:
> >> + rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE &&
> >> + rxfh.input_xfrm == RXH_XFRM_NO_CHANGE))
> >
> > This looks fine, but we also need a check to make sure input_xfrm
> > doesn't have bits other than RXH_XFRM_SYM_XOR set, right?
>
> I wrote the xfrm as a bitmap/flags assuming we can have multiple
> transformations set. Not sure what future transformations will look like
> (other than RSS-sort,... and discussed before).
Ack, but right now the only valid inputs for the kernel are
0 (disable all), RXH_XFRM_NO_CHANGE and RXH_XFRM_SYM_XOR.
We need to reject all other inputs. If we accept random
inputs without validation we won't be able to use them later.
Refer to many LWN articles about how some syscall didn't check
that unused flags are 0 and now they can't allocate bits.
Because some user space was passing in garbage.
> Else, we can do the check you mentioned or may be better to have it as
> enum (which would give us 256, not 8, allowable transformations).
Given that RXH_XFRM_SYM_XOR is 1 we can change the exact semantics
later. All that matters is that we reject unsupported for now.
next prev parent reply other threads:[~2024-01-03 22:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 18:42 [PATCH net-next 0/2] Bug fixes for RSS symmetric-xor Ahmed Zaki
2023-12-21 18:42 ` [PATCH net-next 1/2] net: ethtool: copy input_xfrm to user-space in ethtool_get_rxfh Ahmed Zaki
2023-12-21 18:42 ` [PATCH net-next 2/2] net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm Ahmed Zaki
2024-01-03 0:05 ` Jakub Kicinski
2024-01-03 15:40 ` Ahmed Zaki
2024-01-03 22:16 ` Jakub Kicinski [this message]
2024-01-03 0:10 ` [PATCH net-next 0/2] Bug fixes for RSS symmetric-xor 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=20240103141654.44ac19e9@kernel.org \
--to=kuba@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=alexander.duyck@gmail.com \
--cc=andrew@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
--cc=willemdebruijn.kernel@gmail.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).