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.133.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 5F70131ED89 for ; Thu, 20 Nov 2025 11:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763638022; cv=none; b=QkK7VjW4q4ZrDkcpG4zNsnQojpO2jTIokHkVxUEKtCoC4lIyl1f613NvNK/EjVOwX/Eg+9Jelj/j0IM8H9ipTbfR1CjwIdBB4iQTbtYiREdz+mQa1qz72ylcBQGTm4PHZN4rwoF8Ce3p/q+tWUlQQZAo0VWTLirvUtgvt7pKqD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763638022; c=relaxed/simple; bh=YJqucc6y3evWF4wSv56D5Hg6FOQn5YFJUMPL4VlHK4c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NFMkyReGj/pNlzjkFfU0mXok3dCGXq/8yvbfpWhz13JvewoYgMI5+LFVGhO4IKRnmfBlqdO6mqF3OmWqM+nJBtxKnkjljSJkrzjQPFCZhdjkoMqZs2b0uI1MOyY41tcMLxrSQbvFWhuUcWZbYVR9KKRbv0rfhe+LWmHsMd44t4A= 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=PNMo9QOC; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=aUTtYlrS; arc=none smtp.client-ip=170.10.133.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="PNMo9QOC"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="aUTtYlrS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763638019; 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=sqS+S451NRmIYeRi6IUton5nKAKTYp9P1BRktE8Qx5E=; b=PNMo9QOCGj9HeBrvKRuMwbMkhKiFONIhNFxhAVtpH8pGPmqjbklr9vYf4Kg2w8hbtFu2+h tBeCQ8p1G9gWhrOrfB0Aubw6JIUj0RQeXKUbwTvhRA3sknWDAlUU2hKKk4RWUYy12jKuNG D0apc187JrffGtdFcVaLrVp+exVbc2A= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-rWNEaqxIOW6-Qba8hjL18g-1; Thu, 20 Nov 2025 06:26:52 -0500 X-MC-Unique: rWNEaqxIOW6-Qba8hjL18g-1 X-Mimecast-MFC-AGG-ID: rWNEaqxIOW6-Qba8hjL18g_1763638012 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-47788165c97so5031415e9.0 for ; Thu, 20 Nov 2025 03:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763638011; x=1764242811; 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=sqS+S451NRmIYeRi6IUton5nKAKTYp9P1BRktE8Qx5E=; b=aUTtYlrSM+SSWKPDdL8phWLZ8WsAnPeIaSSnIOvATgS1R+Q2is1K+lIvdk+CaCk8Mn xAwWsTXk9qZI1fP/qrXvmGybknlPpQZVNvCO6j7NRHJL4OFkm1/L0ct1f/9oBn81WpXC 2s7NZ1i2mjI4CU4UDJwQJWzjvwQ9PhyP4h4pNWAd7OowLtFnEw/qWJphl61jmxR6B1Vd ubxPgcigmHuZjzLrPYifONHXDMzvoftwwML5tj1eCzgPE9ruwJFK3aN8sO/K4lgsa4dY ZystGxk16GSOOhLIDAQtqthlODDNXavifUMBYiQduO5N0y+G4rkWOVvP7EHFzmlEa47T 0e8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763638011; x=1764242811; 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=sqS+S451NRmIYeRi6IUton5nKAKTYp9P1BRktE8Qx5E=; b=MxIuJxhSOeKM3ZxhUgW7haofbWHKAM56NQE5XHM5F88umS28GS/LD54rbenI3rqWX7 WywRYD77Hzx6ZhcJKvEDi9tEwM5NTKJZesdzfdjrrCfhh2VgrMgUjlvVIcaztauHKAlW 0ZmdeQ0uRfadd0gxBzeTE7e/LlkGSsJ4+TIVpIDmOkUrSQafOjbk8GXytIbP5lJkWfmH 9ZjHukWebYM1D1aNtpc8PsI3FiiMhStEAhv3V9vNC8cvkgqFkq1Uxg+rK50k/49T+Y2Y PvPNLkZJPlBQG1MN2bC/6VKtfLn2Xm69vfv3gPM5sjtSotuUcEpcB+O+qhSJ29ECpHWt zqbg== X-Forwarded-Encrypted: i=1; AJvYcCVFMnYE9hsRuSjC5+M6lXP6y5Tv1Yma24ZrjvpsAoPGKeTNt3DFipOg5gQoW1ppcvhZNsXKOaDR4a1JEgY=@vger.kernel.org X-Gm-Message-State: AOJu0YyclKXGW45474bVhs5r8QSkwHbM9wl/vqK6IQISYL2GozZWpQIt /4qqmeTpx8kXwnXgwRQCyfku1AU6c1m19Oio0W+MAIGBy2z0RxESDH8XUdx5e5zPtYw18l18Sjq nFHT5R4CIdyaWyE3+I8OsCJroyxqAaSOvNPv5pUA9vIpYcQeukRm9soO6uW+Pop4nCQ== X-Gm-Gg: ASbGncs9CpzRX3cl4i0WwK/z7/Hn5iUW9PekcvQeggPj091o89dpmVdaYBu4OLixQ8O IUL8Xe9QO2BZu3e0fFXUArbkN9xFHe9qCuME5IF65MgPRMVj9oFj1U4/rnJCKXgDfV3qRRCWJHh iIvc0laozE7eaKi4zF2bDrn9R8dHKNPIlqSyV2CgpvalNmJ2dHjYfLTi50DD1AlgMLJHKUScYwl ej/sdhuwHSejMsaqyytnPo56VnLgb5n7yTu1cauKl8G9uJFEEIfC4sIX2SXw0uwc3mTG8WW84cr jUyyMpWphJSBMlRrhMnnDPaj5MqNThF6JVYeImLFmP8E6OjKmrpM87Y6KhF9lgZ6PLcJ/eNUrLi 3Hku7pFt40Lza X-Received: by 2002:a05:600c:4f51:b0:471:9da:524c with SMTP id 5b1f17b1804b1-477babcf75emr19620865e9.12.1763638011506; Thu, 20 Nov 2025 03:26:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeKEOaazfM9KhQXI1DdCaf+McPmoAWzMH7ECavD7fZB8Di1CGCkdsdqX4WGC/qULZnN/Krbw== X-Received: by 2002:a05:600c:4f51:b0:471:9da:524c with SMTP id 5b1f17b1804b1-477babcf75emr19620605e9.12.1763638011115; Thu, 20 Nov 2025 03:26:51 -0800 (PST) Received: from [192.168.88.32] ([212.105.155.41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a9dea7fcsm62835665e9.8.2025.11.20.03.26.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Nov 2025 03:26:50 -0800 (PST) Message-ID: <038697aa-a11c-45ce-a270-258403cc1457@redhat.com> Date: Thu, 20 Nov 2025 12:26:49 +0100 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 REPOST net v2] atm/fore200e: Fix possible data race in fore200e_open() To: Gui-Dong Han , 3chas3@gmail.com, horms@kernel.org, kuba@kernel.org Cc: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, baijiaju1990@gmail.com, stable@vger.kernel.org References: <20251118033330.1844136-1-hanguidong02@gmail.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20251118033330.1844136-1-hanguidong02@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/18/25 4:33 AM, Gui-Dong Han wrote: > Protect access to fore200e->available_cell_rate with rate_mtx lock to > prevent potential data race. > > In this case, since the update depends on a prior read, a data race > could lead to a wrong fore200e.available_cell_rate value. > > The field fore200e.available_cell_rate is generally protected by the lock > fore200e.rate_mtx when accessed. In all other read and write cases, this > field is consistently protected by the lock, except for this case and > during initialization. > > This potential bug was detected by our experimental static analysis tool, > which analyzes locking APIs and paired functions to identify data races > and atomicity violations. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: stable@vger.kernel.org > Signed-off-by: Gui-Dong Han > Reviewed-by: Simon Horman > --- > v2: > * Added a description of the data race hazard in fore200e_open(), as > suggested by Jakub Kicinski and Simon Horman. It looks like you missed Jakub's reply on v2: https://lore.kernel.org/netdev/20250123071201.3d38d8f6@kernel.org/ The above comment is still not sufficient: you should describe accurately how 2 (or more) CPUs could actually race causing the corruption, reporting the relevant call paths leading to the race. Thanks, Paolo