From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97F4C3E9F79 for ; Wed, 22 Apr 2026 19:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776885455; cv=none; b=Av/HBSlmIYeaTMCNTZMtuaUVxcsZVxCVwqe7dkgCCOn404knvqTSclIL6f/QipKe8zjpLAi8pvWP1UigsIjjE77tFooc2ptlwZHW3gbq9UWcmTkzhVEXQOC1iB1TEr0Cul2gsTHoYy4Wh4oRZRoBIK/Ob61Gy3e391+qV3OwP/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776885455; c=relaxed/simple; bh=6xwAF6LQhdvQWGciR8NgWuvUr+MpJGOUxwxYpgWHEt0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tfobJnRwmvAUDqWZRGoVmuVE5QdySZTOEjufBvc7LsyNzngnghi90qOdWEcLLCENp8HHY8qybEqnK7i7YDE7HvYsBp4PNdBEIsXQKCD16ClTFSuzmvinbHZF9TyPPdd2NBymNHaMf4UylzipGCaFQOZyxi8T4KZ5RPsFVNsO+8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ytr94msm; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=mlpT3hGK; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ytr94msm"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="mlpT3hGK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776885443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c58WyJAsGl6Zxg673v15wl6Ol9ueBA67C9y/ZIOdNaQ=; b=Ytr94msmHisYHuCoYauxPZlVBrZu21ptqAzPFzzQBU4nGZGPFjZvZz44kez0frB75aCPft eZe7IqqW3NK/3DeCh2Pq6uR5BddVPTJWdvy1N77MQpxy1GOoT1N0/fjmZA6c4UDlZOUjLR WH4vnw5hXv8CM8Sc52j8a7rRXi6SbS8= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-3JHu-8yBOeabK-mI7oSrjA-1; Wed, 22 Apr 2026 15:17:21 -0400 X-MC-Unique: 3JHu-8yBOeabK-mI7oSrjA-1 X-Mimecast-MFC-AGG-ID: 3JHu-8yBOeabK-mI7oSrjA_1776885440 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-4362197d1easo4394869f8f.2 for ; Wed, 22 Apr 2026 12:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776885440; x=1777490240; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=c58WyJAsGl6Zxg673v15wl6Ol9ueBA67C9y/ZIOdNaQ=; b=mlpT3hGKvoodnx0UB/ptVDAUML0sJn1An5jX10fAd7L0s2NY/yvhxybWUcxJfxm3Vc njwPz2gvUv3Xm6YtskBlLZHdCb53kTzRy9DDFTLEO4uIAIGoFNll26JzPNDpCF4NPXol snIu7wcDyCyNKMmR8SFwVh898AW9Um4QuIWcX+8jvWziUoeeF3K9rL23HUxIa85SCC3Y XqkZnxodMGro6Su8K+zhf5fyN9SzKxm/RPQeG1JZyRvWJY3fiJhfaljo0eYxQu+GAH6z +N2Y5xaMc0D6JUnGa++r7qP5KSYTNLxEf9+bnuJMZry2yGxdj6BT/W/GViDV9WfR1XZM sa5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776885440; x=1777490240; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c58WyJAsGl6Zxg673v15wl6Ol9ueBA67C9y/ZIOdNaQ=; b=BV2TecmmuXH0maVsB2hNCuMXA/sbCBdB2/d7gQr/2pWOuoqjsoKXxEb41ld3rNNkMj bH6pDsSV/XZDLAhzARddKFpKCPPwuYGr2EbL9Ik2IFfWT0I3ZqcdrOAmQ658qw8K0C4a GuHcKqTBJ3iWKm2Bmb12XGj+BYgzw5tILrYURYOMErm3lQ72fvcfzLm/W1SxnPOBhve5 hhcZEM5sfIPBS/RMQ5q+wFEHuamHc7jfWuQMkBT4ze5xJ/R+W+wpxQZvYXX3f4YUtlRv Z6DwS0x1BW/xzaJ1erm7Fu0h1f+86YU4O0e6pI9Rgzqk0FVq+1pbyK4nlHFquB2evpOs 1nhw== X-Forwarded-Encrypted: i=1; AFNElJ+0RyeHZjhmTVrNhRTBZaYDv13KIigAWVNCBI2R5jhC+6BZGKKqtti06iJer7Wz+9DJ5NbvdRoVlP/Evwc=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ7wRkLvO1B6GPOmhk1ZzQkm/eDQSgx4FeeZZkMiF6xXlnxO02 jQVMfcZHOINqx/3hV9AW82xykYJPPi1Fuv1dP1n46EM8c7Ol+qkBfe6jWtQP925gze5SlV7mpMS zP82xhXI4T7WF2YYz6Ltx5+kWlpWD83xSF9BEpEQLb9DRlApLBDRG1YiQtMFN1tPMHA== X-Gm-Gg: AeBDietyLLST9m+ByaCJ7b2O/8dEOJ4NtLtJxvztcvUwy/qjXVC+8ac7JYXgtryaSc9 Wl+wlFET5sSXyCFXzhispGl2taV6iEzw64YKz5FEQf1H+LY/oEse44VjTYFvwFJQfaiKEUx/3Di /LP+jFBSYFTXqy+3uT0L93Oeh/zIkH3stfAXdfJvIQKsjqmsmx0R44hu2nqYMnnrnRBDpAT0QS5 6aubRAZ4muhLoZ3bfwC0a9UuoaslVjWEG+49/dqnfMMZEga0BD9Dh1bovGWrppPbQJUE6ErxwxI fdf6Xd/TZ6fi1NZlcKn//UuxctvTrW0h3As/+s8SdaachuT06pb3Aa9RS2WR4WobQJ4nrxi8kch IVV0KQx/rtM5U2IQpsO0U7JwcWspTaRk= X-Received: by 2002:a05:600c:2e42:b0:489:1fa4:50c6 with SMTP id 5b1f17b1804b1-4891fa451bamr103358835e9.20.1776885440433; Wed, 22 Apr 2026 12:17:20 -0700 (PDT) X-Received: by 2002:a05:600c:2e42:b0:489:1fa4:50c6 with SMTP id 5b1f17b1804b1-4891fa451bamr103358605e9.20.1776885439968; Wed, 22 Apr 2026 12:17:19 -0700 (PDT) Received: from [192.168.2.83] ([46.175.183.46]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e44f69sm49650997f8f.25.2026.04.22.12.17.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Apr 2026 12:17:19 -0700 (PDT) Message-ID: Date: Wed, 22 Apr 2026 21:17:16 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH iwl-net] ice: fix infinite recursion in ice_cfg_tx_topo via ice_init_dev_hw To: Simon Horman Cc: netdev@vger.kernel.org, Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Aleksandr Loktionov , Nikolay Aleksandrov , Daniel Zahka , Paul Greenwalt , Dave Ertman , Michal Swiatkowski , jacob.e.keller@intel.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org References: <20260413191420.3524013-1-poros@redhat.com> <20260415163003.GP772670@horms.kernel.org> Content-Language: en-US From: Petr Oros In-Reply-To: <20260415163003.GP772670@horms.kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/15/26 18:30, Simon Horman wrote: > On Mon, Apr 13, 2026 at 09:14:20PM +0200, Petr Oros wrote: >> On certain E810 configurations where firmware supports Tx scheduler >> topology switching (tx_sched_topo_comp_mode_en), ice_cfg_tx_topo() >> may need to apply a new 5-layer or 9-layer topology from the DDP >> package. If the AQ command to set the topology fails (e.g. due to >> invalid DDP data or firmware limitations), the global configuration >> lock must still be cleared via a CORER reset. >> >> Commit 86aae43f21cf ("ice: don't leave device non-functional if Tx >> scheduler config fails") correctly fixed this by refactoring >> ice_cfg_tx_topo() to always trigger CORER after acquiring the global >> lock and re-initialize hardware via ice_init_hw() afterwards. >> >> However, commit 8a37f9e2ff40 ("ice: move ice_deinit_dev() to the end >> of deinit paths") later moved ice_init_dev_hw() into ice_init_hw(), >> breaking the reinit path introduced by 86aae43f21cf. This creates an >> infinite recursive call chain: >> >> ice_init_hw() >> ice_init_dev_hw() >> ice_cfg_tx_topo() # topology change needed >> ice_deinit_hw() >> ice_init_hw() # reinit after CORER >> ice_init_dev_hw() # recurse >> ice_cfg_tx_topo() >> ... # stack overflow >> >> Fix by moving ice_init_dev_hw() back out of ice_init_hw() and calling >> it explicitly from ice_probe() and ice_devlink_reinit_up(). The third >> caller, ice_cfg_tx_topo(), intentionally does not need ice_init_dev_hw() >> during its reinit, it only needs the core HW reinitialization. This >> breaks the recursion cleanly without adding flags or guards. >> >> The deinit ordering changes from commit 8a37f9e2ff40 ("ice: move >> ice_deinit_dev() to the end of deinit paths") which fixed slow rmmod >> are preserved, only the init-side placement of ice_init_dev_hw() is >> reverted. >> >> Fixes: 8a37f9e2ff40 ("ice: move ice_deinit_dev() to the end of deinit paths") >> Signed-off-by: Petr Oros > Hi Petr, > > I don't intended to delay this patch. > But could you follow-up by looking over the AI generated > review of this patch on sashiko.dev? > > Thanks! > Hi Simon, Thanks, the sashiko.dev concern is valid. ice_init_dev_hw() swallowing -ENODEV from the torn-down hw is a latent UAF independent of the recursion fix here. I will send a follow-up patch that propagates -ENODEV to abort probe cleanly. Regards, Petr