From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 013.lax.mailroute.net (013.lax.mailroute.net [199.89.1.16]) (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 0414E3AA1A1 for ; Tue, 24 Feb 2026 17:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771955018; cv=none; b=GtPSYz/yUKVRqLw8f6qq2WNFWzez8g72iL3Lc7Twc3p8kyznImp+4zn6d299G9uBgijb51JMVQI1SKq5X/SVH3nWjzoOJMO2MJLjbuVeyCi2hjAWEq5N+6JuQJvcf2jmVZjw+De8/q3m2n/eyxRWWL5Pn5xSuMnxpDQ/Er+e1qM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771955018; c=relaxed/simple; bh=tyzN9v8BOOJhCYwPEF8l+zXt+G96klqbPSrfRQv/vJg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GBundF/hbxVq3YV68m5i05jPPsYMRQajO1/E439oSmEZl2sNYtfPWGOlfDm8bEasUnTJPDrGUU+feNG+N/FDXZHPadSKnWk/b98bm4zh+SvtBx2F+aae5G02oLj0G6xpEPfkBs3jyNCKL+w3QXx6rZNyhH88ueNaEjpCki8OoRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=0Y4zRIXX; arc=none smtp.client-ip=199.89.1.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="0Y4zRIXX" Received: from localhost (localhost [127.0.0.1]) by 013.lax.mailroute.net (Postfix) with ESMTP id 4fL4p03WP9zlfgPZ; Tue, 24 Feb 2026 17:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1771955013; x=1774547014; bh=nBvRF3BmBejuGZVpPKazemSs UY6chbThwHxhuBC81AQ=; b=0Y4zRIXXBVwSQ8SwE6np5M4d5j5fFr/49M0tZBnw U6114YH3R2bHsj/LomKcoys5Wp72UCzg8EZfP7/FzJAlncUpyrVltWyq6HhTXw0s slLZiObDT/zxdrfKMuUrFMAT3qn5WtScI/oyJWN0OC9v+mLcu8ULByrTjAERkmQ+ RxoivxVrlyGHL/Cqwg2T57s+5/dGI9yL6LHRpaon3aQPqeXP/BRWy7f1rVdEBKxc tyZ6prbIuRMFszF6A8QvniwaPN621lY7Ob/Z5/EDzl5IxFYwICwUCjW7Exag3/SU Io4+4Q3dul45asOpPeKAf0ZJ/eLp7oU7cVfErmVghTE4vw== X-Virus-Scanned: by MailRoute Received: from 013.lax.mailroute.net ([127.0.0.1]) by localhost (013.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id G7lB1LngIYLA; Tue, 24 Feb 2026 17:43:33 +0000 (UTC) Received: from [172.20.150.38] (unknown [4.28.11.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 013.lax.mailroute.net (Postfix) with ESMTPSA id 4fL4nr1JmgzlfgRx; Tue, 24 Feb 2026 17:43:27 +0000 (UTC) Message-ID: Date: Tue, 24 Feb 2026 09:43:27 -0800 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 19/62] ice: Fix a locking bug in an error path To: Przemek Kitszel , Bart Van Assche , Tony Nguyen Cc: Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , linux-kernel@vger.kernel.org, Peter Zijlstra , Marco Elver , Christoph Hellwig , Steven Rostedt , Nick Desaulniers , Nathan Chancellor , Kees Cook , Jann Horn , intel-wired-lan@lists.osuosl.org References: <20260223220102.2158611-1-bart.vanassche@linux.dev> <20260223220102.2158611-20-bart.vanassche@linux.dev> <51a3c969-6fca-415f-a27c-d1ad8c9d3c71@intel.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <51a3c969-6fca-415f-a27c-d1ad8c9d3c71@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/24/26 12:40 AM, Przemek Kitszel wrote: > On 2/23/26 23:00, Bart Van Assche wrote: >> From: Bart Van Assche >> >> Move the mutex_lock() call up to prevent that DCB settings change after >> the ice_query_port_ets() call. >> >> This patch fixes a bug in an error path. Without this patch pf->tc_mutex >> may be unlocked in an error path without having been locked. This bug has >> been detected by the clang thread-safety analyzer. > > Thank you. This is a good catch, and current error path is obviously > wrong, in the way you have described. > > From the commit msg alone, it is not clear why moving the lock up, > instead moving the unlock to match the lock order, is right. Please take a look at the prior discussion of this change, available here: https://lore.kernel.org/all/61e3cc7a-af79-48e4-acb6-8ac7c8d2552c@intel.com/ > But from the code, I see that you are right - we call > ice_query_port_ets() again under the lock some 20 lines below (L566) > > Let us know If you want to enhance your commit message (including the > subject), as it looks like a big quasi-automated series. I have been asked to split this patch series and to send it directly to the maintainers of the modified subsystems. Suggestions for how to improve the patch description are welcome. Thanks, Bart.