From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 23538231836 for ; Thu, 29 Jan 2026 19:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769713422; cv=none; b=cuBd3onwgeQ/0GttYC2GhTT6TYflND6ovszqcMyZDKjyQTkGH7UmQY7Zl7L43GtWlQTLxEybGyREGHuNuwvig/lMhMplZCTWn9ZpyemRDLEQ0lObYZ45nP1Y74rb3ZrnhTMODlLxUSGcN3WRelHG+19/JlxjZRQIw4nKZYAFP68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769713422; c=relaxed/simple; bh=6LkseC6LC7ALnvlzx5abUYnyWpRhz8Mb/gjC8+HkUPQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Rpb/ExpAV6Bz9/V6GxIgfIM93lmAg8KkcgcY/bU5j1/JuvcQiUE9mK34GWAy8/NP6P04SwNr2Sw3+SVUOBPpCYZ7AgmtNmFFKZAeMCme+5g6BMRrDcTUTOR0uwjoRSouabKgT054756Nb+MMKIEUSn23IlAAiyhVlP6lwGFZ/xE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=BH4gOlPe; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="BH4gOlPe" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769713409; 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=A6kTyM3GeRdLGQZI7pzMmWc5l+zbSMFzRj+5AluvRlk=; b=BH4gOlPeEIUSOMSfF0ZSaktXankCYoXjWR7kR3Gq6q9oZjue6jSZMrhFWclFii4eZOq3m0 oi3CzQtLh8F/cyGX8WAYu0RQHwCvsQbjq+Hzg5+qu5JCtrWgv1DBe1qRWvE8AbFA/fTDaf 0BnQjqlZbHiZoj6EFANNY2sJLEGWfUA= Date: Thu, 29 Jan 2026 19:03:23 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net] iavf: fix PTP use-after-free during reset To: Petr Oros , netdev@vger.kernel.org Cc: ivecera@redhat.com, mschmidt@redhat.com, Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Jacob Keller , Simon Horman , Mateusz Polchlopek , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org References: <20260129095723.7269-1-poros@redhat.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20260129095723.7269-1-poros@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 29/01/2026 09:57, Petr Oros wrote: > Commit 7c01dbfc8a1c5f ("iavf: periodically cache PHC time") introduced a > worker to cache PHC time, but failed to stop it during reset or disable. > > This creates a race condition where `iavf_reset_task()` or > `iavf_disable_vf()` free adapter resources (AQ) while the worker is still > running. If the worker triggers `iavf_queue_ptp_cmd()` during teardown, it > accesses freed memory/locks, leading to a crash. > > Fix this by calling `iavf_ptp_release()` before tearing down the adapter. > This ensures `ptp_clock_unregister()` synchronously cancels the worker and > cleans up the chardev before the backing resources are destroyed. > > Fixes: 7c01dbfc8a1c5f ("iavf: periodically cache PHC time") > Signed-off-by: Petr Oros > --- > drivers/net/ethernet/intel/iavf/iavf_main.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Vadim Fedorenko