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]
Message-ID: <MW4PR11MB591177888AFF2E9EFF199E8ABAE62@MW4PR11MB5911.namprd11.prod.outlook.com>
Date: Thu, 9 May 2024 23:01:58 +0000
From: "Singh, Krishneil K" <krishneil.k.singh@...el.com>
To: "Zaremba, Larysa" <larysa.zaremba@...el.com>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "intel-wired-lan@...ts.osuosl.org"
	<intel-wired-lan@...ts.osuosl.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>
CC: "Zaremba, Larysa" <larysa.zaremba@...el.com>, "Brady, Alan"
	<alan.brady@...el.com>, "Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>, "Tantilov, Emil S"
	<emil.s.tantilov@...el.com>, "Linga, Pavan Kumar"
	<pavan.kumar.linga@...el.com>, "Hay, Joshua A" <joshua.a.hay@...el.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>, "Bagnucki, Igor"
	<igor.bagnucki@...el.com>
Subject: RE: [PATCH iwl-net] idpf: Interpret .set_channels() input differently

> -----Original Message-----
> From: Larysa Zaremba <larysa.zaremba@...el.com>
> Sent: Friday, April 26, 2024 8:41 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; intel-wired-
> lan@...ts.osuosl.org; linux-kernel@...r.kernel.org; netdev@...r.kernel.org
> Cc: Zaremba, Larysa <larysa.zaremba@...el.com>; Brady, Alan
> <alan.brady@...el.com>; Fijalkowski, Maciej <maciej.fijalkowski@...el.com>;
> Brandeburg, Jesse <jesse.brandeburg@...el.com>; Tantilov, Emil S
> <emil.s.tantilov@...el.com>; Linga, Pavan Kumar
> <pavan.kumar.linga@...el.com>; Hay, Joshua A <joshua.a.hay@...el.com>;
> Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>; Bagnucki, Igor
> <igor.bagnucki@...el.com>
> Subject: [PATCH iwl-net] idpf: Interpret .set_channels() input differently
> 
> Unlike ice, idpf does not check, if user has requested at least 1 combined
> channel. Instead, it relies on a check in the core code. Unfortunately, the
> check does not trigger for us because of the hacky .set_channels()
> interpretation logic that is not consistent with the core code.
> 
> This naturally leads to user being able to trigger a crash with an invalid
> input. This is how:
> 
> 1. ethtool -l <IFNAME> -> combined: 40
> 2. ethtool -L <IFNAME> rx 0 tx 0
>    combined number is not specified, so command becomes {rx_count = 0,
>    tx_count = 0, combined_count = 40}.
> 3. ethnl_set_channels checks, if there is at least 1 RX and 1 TX channel,
>    comparing (combined_count + rx_count) and (combined_count + tx_count)
>    to zero. Obviously, (40 + 0) is greater than zero, so the core code
>    deems the input OK.
> 4. idpf interprets `rx 0 tx 0` as 0 channels and tries to proceed with such
>    configuration.
> 
> The issue has to be solved fundamentally, as current logic is also known to
> cause AF_XDP problems in ice [0].
> 
> Interpret the command in a way that is more consistent with ethtool
> manual [1] (--show-channels and --set-channels) and new ice logic.
> 
> Considering that in the idpf driver only the difference between RX and TX
> queues forms dedicated channels, change the correct way to set number of
> channels to:
> 
> ethtool -L <IFNAME> combined 10 /* For symmetric queues */
> ethtool -L <IFNAME> combined 8 tx 2 rx 0 /* For asymmetric queues */
> 
> [0] https://lore.kernel.org/netdev/20240418095857.2827-1-
> larysa.zaremba@...el.com/
> [1] https://man7.org/linux/man-pages/man8/ethtool.8.html
> 
> Fixes: 02cbfba1add5 ("idpf: add ethtool callbacks")
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> Reviewed-by: Igor Bagnucki <igor.bagnucki@...el.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
> ---
>  .../net/ethernet/intel/idpf/idpf_ethtool.c    | 21 ++++++-------------
>  1 file changed, 6 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> index 986d429d1175..1cf3067a9c31 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c

Tested-by: Krishneil Singh <krishneil.k.singh@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ