From: Leon Romanovsky <leon@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: David Miller <davem@davemloft.net>,
kuba@kernel.org, netdev@vger.kernel.org, kernel-team@fb.com,
jiri@resnulli.us, andrew@lunn.ch, mkubecek@suse.cz,
Saeed Mahameed <saeedm@nvidia.com>
Subject: Re: [PATCH net-next v2 0/7] ethtool: allow dumping policies to user space
Date: Wed, 7 Oct 2020 13:47:43 +0300 [thread overview]
Message-ID: <20201007104743.GA3678159@unreal> (raw)
In-Reply-To: <7f26de5605d4d19eda19f35b2a239d7098fad7b3.camel@sipsolutions.net>
On Wed, Oct 07, 2020 at 10:29:01AM +0200, Johannes Berg wrote:
> On Wed, 2020-10-07 at 11:24 +0300, Leon Romanovsky wrote:
> > On Wed, Oct 07, 2020 at 09:30:51AM +0200, Johannes Berg wrote:
> > > On Wed, 2020-10-07 at 09:27 +0300, Leon Romanovsky wrote:
> > > > This series and my guess that it comes from ff419afa4310 ("ethtool: trim policy tables")
> > > > generates the following KASAN out-of-bound error.
> > >
> > > Interesting. I guess that is
> > >
> > > req_info->counts_only = tb[ETHTOOL_A_STRSET_COUNTS_ONLY];
> > >
> > > which basically means that before you never actually *use* the
> > > ETHTOOL_A_STRSET_COUNTS_ONLY flag, but of course it shouldn't be doing
> > > this ...
> > >
> > > Does this fix it?
> >
> > Yes, it fixed KASAN, but it we got new failure after that.
>
> Good.
>
> I'm not very familiar with ethtool netlink tbh :)
>
> > 11:07:51 player_id: 1 shell.py:62 [LinuxEthtoolAgent] DEBUG : running command(/opt/mellanox/ethtool/sbin/ethtool --set-channels eth2 combined 3) with pid: 13409
> > 11:07:51 player_id: 1 protocol.py:605 [OpSetChannels] ERROR : RC:1, STDERR:
> > netlink error: Unknown attribute type (offset 36)
> > netlink error: Invalid argument
>
> That's even stranger, since strict validation should've meant this was
> always rejected? Hmm.
>
> Oh, copy/paste error I guess, try this:
Thanks, it fixed and everything passed.
>
> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index 8a85a4e6be9b..50d3c8896f91 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -830,8 +830,8 @@ static const struct genl_ops ethtool_genl_ops[] = {
> .cmd = ETHTOOL_MSG_CHANNELS_SET,
> .flags = GENL_UNS_ADMIN_PERM,
> .doit = ethnl_set_channels,
> - .policy = ethnl_channels_get_policy,
> - .maxattr = ARRAY_SIZE(ethnl_channels_get_policy) - 1,
> + .policy = ethnl_channels_set_policy,
> + .maxattr = ARRAY_SIZE(ethnl_channels_set_policy) - 1,
> },
> {
> .cmd = ETHTOOL_MSG_COALESCE_GET,
>
> johannes
>
next prev parent reply other threads:[~2020-10-07 10:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 22:07 [PATCH net-next v2 0/7] ethtool: allow dumping policies to user space Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 1/7] ethtool: wire up get policies to ops Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 2/7] ethtool: wire up set " Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 3/7] ethtool: trim policy tables Jakub Kicinski
2020-10-08 9:12 ` Eric Dumazet
2020-10-08 9:13 ` Johannes Berg
2020-10-08 9:15 ` Johannes Berg
2020-10-08 15:09 ` Eric Dumazet
2020-10-05 22:07 ` [PATCH net-next v2 4/7] ethtool: link up ethnl_header_policy as a nested policy Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 5/7] netlink: create helpers for checking type is an int Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 6/7] netlink: add mask validation Jakub Kicinski
2020-10-05 22:07 ` [PATCH net-next v2 7/7] ethtool: specify which header flags are supported per command Jakub Kicinski
2020-10-06 6:43 ` [PATCH net-next v2 0/7] ethtool: allow dumping policies to user space Johannes Berg
2020-10-06 13:26 ` David Miller
2020-10-07 6:27 ` Leon Romanovsky
2020-10-07 7:30 ` Johannes Berg
2020-10-07 8:24 ` Leon Romanovsky
2020-10-07 8:29 ` Johannes Berg
2020-10-07 8:33 ` Leon Romanovsky
2020-10-07 10:47 ` Leon Romanovsky [this message]
2020-10-07 8:52 ` Michal Kubecek
2020-10-07 10:48 ` Leon Romanovsky
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=20201007104743.GA3678159@unreal \
--to=leon@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=kernel-team@fb.com \
--cc=kuba@kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.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).