lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 07 Oct 2020 10:29:01 +0200
From:   Johannes Berg <johannes@...solutions.net>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     David Miller <davem@...emloft.net>, kuba@...nel.org,
        netdev@...r.kernel.org, kernel-team@...com, jiri@...nulli.us,
        andrew@...n.ch, mkubecek@...e.cz,
        Saeed Mahameed <saeedm@...dia.com>
Subject: Re: [PATCH net-next v2 0/7] ethtool: allow dumping policies to user
 space

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:

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ