Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5020806ybb; Tue, 24 Mar 2020 09:29:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrPF2XjysEgG8IOriTrNB8d6dAMznWTW6o8rLSS4qzuJlumd13bJhk2CjGP120qreAa2OS X-Received: by 2002:a9d:1988:: with SMTP id k8mr11651264otk.4.1585067355097; Tue, 24 Mar 2020 09:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585067355; cv=none; d=google.com; s=arc-20160816; b=dHhe3QMamBOs0TeZHjiWcoQ/b7WbaWVTaVCzDHKyHL2D+35Vw4WZt+cHrxT9Iup6O6 BQNKPu6xP130/GvTt5N9TG3zYA948MWy3cgHVIxRXOmyFa8tGLUnKH927c/8g+YUDFlm 3cjBiOYGDxLpWysujBYCZYfLvsvt2smBxIc2ljzaO6B1ww/Ua8CuHFFeSw3j7+NsBt2R SboeLrmVzqLAuSLQFLM7q1Ir4O0jNPjGWjObvRg3Dbtb0ZKURRoDwVh2++9dzuE4lcZ6 jK95Ov/7GlIachWPc0BwbbuhquQLH0uinYeDTpU/KBZFN9umUc+eG3FIpXWPD4/747VC utsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=eek9Ivo4aDvJ5B7hp9YxKh6LCPTd1kdyE0EFkkcNOKw=; b=aRMakf3lYIDzuPwRkCYKHWouaX/7EgOCEYTpNkTjiwrDjqzNnU6y46f1itPw/V2XCh b0NCDd+opd1k4oEp/VuLx+Ev2dCPfa3vw8hVQ69sBraP9wL0rvi/vZbC3ZVJFiQ7rjYN qT5NMGM2BUj+5dhysQeKYtKsThxhUhnrv7sxwfiU3/KdspdQSLWRlTpIw4vGHvBs9sCL PUXX9hjpwJ5rMQRvEgS3P5Ch09AknfFgb3qZ6RumaOSiLRzQkFQvuP8TPyG66T8Y5EQF hIHJEQlXrMkuWwkIG9+gn78tzKIQaXhhTeXMJiaitgfZs9wdGZB1+OI0kqohcXN4UqQr s59w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GG3F8Z3D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si6664070otk.135.2020.03.24.09.29.02; Tue, 24 Mar 2020 09:29:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GG3F8Z3D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729011AbgCXQ1S (ORCPT + 99 others); Tue, 24 Mar 2020 12:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728796AbgCXQ1R (ORCPT ); Tue, 24 Mar 2020 12:27:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A90F20788; Tue, 24 Mar 2020 16:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585067236; bh=OvenVnHl0wduNQ7fLdM6lGKydIJWaN8/+ujyCQPdt68=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GG3F8Z3DamEsezlqe5uUwSYKhHoSBCsOH1CvReBCyrJbdVmzoBSEaoPv/egxHTmqw u4L57AFmtNusYvewOS2xMoZfz66EPnA9ADi25j1dMOKR7so8/uyDD8dVvPn0VitWNE ItM72v4be6Kah5eRtkAqfyO66ZXiUl5G+bnYHRHM= Date: Tue, 24 Mar 2020 17:27:14 +0100 From: Greg KH To: Will Deacon Cc: linux-kernel@vger.kernel.org, Eric Dumazet , Jann Horn , Kees Cook , Maddie Stone , Marco Elver , "Paul E . McKenney" , Peter Zijlstra , Thomas Gleixner , kernel-team@android.com, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 01/21] list: Remove hlist_unhashed_lockless() Message-ID: <20200324162714.GB2518046@kroah.com> References: <20200324153643.15527-1-will@kernel.org> <20200324153643.15527-2-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200324153643.15527-2-will@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 03:36:23PM +0000, Will Deacon wrote: > Commit c54a2744497d ("list: Add hlist_unhashed_lockless()") added a > "lockless" variant of hlist_unhashed() that uses READ_ONCE() to access > the 'pprev' pointer of the 'hlist_node', the intention being that this > could be used by 'timer_pending()' to silence a KCSAN warning. As well > as forgetting to add the caller, the patch also sprinkles > {READ,WRITE}_ONCE() invocations over the standard (i.e. non-RCU) hlist > code, which is undesirable for a number of reasons: > > 1. It gives the misleading impression that the non-RCU hlist code is > in some way lock-free (despite the notable absence of any memory > barriers!) and silences KCSAN in such cases. > > 2. It unnecessarily penalises code generation for non-RCU hlist users > > 3. It makes it difficult to introduce list integrity checks because > of the possibility of concurrent callers. > > Retain the {READ,WRITE}_ONCE() invocations for the RCU hlist code, but > remove them from the non-RCU implementation. Remove the unused > 'hlist_unhashed_lockless()' function entirely and add the READ_ONCE() > to hlist_unhashed(), as we do already for hlist_empty() already. > > Cc: Eric Dumazet > Cc: Thomas Gleixner > Cc: Paul E. McKenney > Cc: Peter Zijlstra > Signed-off-by: Will Deacon > --- > include/linux/list.h | 33 ++++++++++----------------------- > 1 file changed, 10 insertions(+), 23 deletions(-) Reviewed-by: Greg Kroah-Hartman