From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B1F5E3AC12 for ; Fri, 10 Nov 2023 19:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s7IwgU2r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDE5AC433C7; Fri, 10 Nov 2023 19:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699645946; bh=ASErf/rN4eiIrM6smaHpuAE1GebOU2yCVy3Hl2BGlt0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s7IwgU2rv2i5oXz5LMfdGA9lGPwV3UZBotxM4Vm+Y73ePVba2R8ZWKFPfscj+eLzE xOZco8Nw1YuYAvOgJjHALtgkGKzvKfO6bzibnRdDOGJ2wuuJXG07Xewxx3b4Y93roy O/sHEx4WhFdUvue2hmNVBfmEcMY7lDOijn6+l6xppdMb2U/2X253DeapXr3WaBcGMA inQB4Zcn8NBMeURZHHLrv+3cEKOSnHLZ0LAbC4a61mju0qt2wFyYpAgtYaWmWvmfTJ D7LQ+DScIbFgjIOBEF0VaFKc2D8rF/kuqI3lrpfgO4EOt1q2tBXXcPiham1Cq5aYUX l1eQG/utZpOeg== Date: Fri, 10 Nov 2023 11:52:24 -0800 From: Jakub Kicinski To: Richard Cochran Cc: Eric Dumazet , "David S . Miller" , Paolo Abeni , netdev@vger.kernel.org, eric.dumazet@gmail.com Subject: Re: [PATCH net] ptp: annotate data-race around q->head and q->tail Message-ID: <20231110115224.3d2f180c@kernel.org> In-Reply-To: References: <20231109174859.3995880-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 10 Nov 2023 09:09:45 -0800 Richard Cochran wrote: > > I do not see how races are solved... Shouldn't > > pccontext->private_clkdata be protected by RCU ? > > Yeah, the test is useless, because the memory is allocated in open() > and later freed in release(). During ioctl() the pointer must be > valid. > > However, there was a bogus call to ptp_release() in the read() method, > but that has now been removed, and so the test is now bogus. Meaning we should revert 8a4f030dbced ("ptp: Fixes a null pointer dereference in ptp_ioctl") ?