netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 11:24:37 +0300	[thread overview]
Message-ID: <20201007082437.GV1874917@unreal> (raw)
In-Reply-To: <cf5fdfa13cce37fe7dcf46a4e3a113a64c927047.camel@sipsolutions.net>

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.

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

>
> diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
> index 3f5719786b0f..d8efec516d86 100644
> --- a/net/ethtool/netlink.h
> +++ b/net/ethtool/netlink.h
> @@ -347,7 +347,7 @@ extern const struct ethnl_request_ops ethnl_tsinfo_request_ops;
>
>  extern const struct nla_policy ethnl_header_policy[ETHTOOL_A_HEADER_FLAGS + 1];
>  extern const struct nla_policy ethnl_header_policy_stats[ETHTOOL_A_HEADER_FLAGS + 1];
> -extern const struct nla_policy ethnl_strset_get_policy[ETHTOOL_A_STRSET_STRINGSETS + 1];
> +extern const struct nla_policy ethnl_strset_get_policy[ETHTOOL_A_STRSET_COUNTS_ONLY + 1];
>  extern const struct nla_policy ethnl_linkinfo_get_policy[ETHTOOL_A_LINKINFO_HEADER + 1];
>  extern const struct nla_policy ethnl_linkinfo_set_policy[ETHTOOL_A_LINKINFO_TP_MDIX_CTRL + 1];
>  extern const struct nla_policy ethnl_linkmodes_get_policy[ETHTOOL_A_LINKMODES_HEADER + 1];
> diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
> index 0734e83c674c..0baad0ce1832 100644
> --- a/net/ethtool/strset.c
> +++ b/net/ethtool/strset.c
> @@ -103,6 +103,7 @@ const struct nla_policy ethnl_strset_get_policy[] = {
>  	[ETHTOOL_A_STRSET_HEADER]	=
>  		NLA_POLICY_NESTED(ethnl_header_policy),
>  	[ETHTOOL_A_STRSET_STRINGSETS]	= { .type = NLA_NESTED },
> +	[ETHTOOL_A_STRSET_COUNTS_ONLY]	= { .type = NLA_FLAG },
>  };
>
>  static const struct nla_policy get_stringset_policy[] = {
>
> johannes
>

  reply	other threads:[~2020-10-07  8:24 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 [this message]
2020-10-07  8:29           ` Johannes Berg
2020-10-07  8:33             ` Leon Romanovsky
2020-10-07 10:47             ` Leon Romanovsky
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=20201007082437.GV1874917@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).