From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21D8DC4363C for ; Wed, 7 Oct 2020 08:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B480E214DB for ; Wed, 7 Oct 2020 08:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602059083; bh=GxmpJaUjn5SjdafKQrEfNO0D+gsvqEr55tdHjRWf85w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=NFBDV81pxGcufcaGgYFKhjemBw5GVc9+UqqM6LbOxFYb52N1+xCCNhDbc4F8Lf1Qo N6mb7ySiyCeN/n9eyRu44RZJflYZo1nKN2kuhBX+wBab3QpupzBPHsJ3xJiJPQx7Jq dLKfxosLPcOiOMRY8UFj6hK3yRPV/5neRdYKjPiY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727782AbgJGIYm (ORCPT ); Wed, 7 Oct 2020 04:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbgJGIYm (ORCPT ); Wed, 7 Oct 2020 04:24:42 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 070D42083B; Wed, 7 Oct 2020 08:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602059081; bh=GxmpJaUjn5SjdafKQrEfNO0D+gsvqEr55tdHjRWf85w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MBllWHyNTIutEnKDMLqK7pYygHFQujFRXsvzOjid+n1/rCA5nNS7ucJGTi4wKRZZj T+E7h040cNAsDb1jcmxMMjgePE2YGQ0uUS5Kb8pgOSsCn9gE5467ZhsbqysirA1Y4M V97uAwjQAHPdRyYCDwiOyxNMZzLcOjOwgpADWDpQ= Date: Wed, 7 Oct 2020 11:24:37 +0300 From: Leon Romanovsky To: Johannes Berg Cc: David Miller , kuba@kernel.org, netdev@vger.kernel.org, kernel-team@fb.com, jiri@resnulli.us, andrew@lunn.ch, mkubecek@suse.cz, Saeed Mahameed Subject: Re: [PATCH net-next v2 0/7] ethtool: allow dumping policies to user space Message-ID: <20201007082437.GV1874917@unreal> References: <20201005220739.2581920-1-kuba@kernel.org> <7586c9e77f6aa43e598103ccc25b43415752507d.camel@sipsolutions.net> <20201006.062618.628708952352439429.davem@davemloft.net> <20201007062754.GU1874917@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 >