From patchwork Tue Mar 24 15:36:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 11455831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E921014B4 for ; Tue, 24 Mar 2020 15:38:50 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 51FF92073E for ; Tue, 24 Mar 2020 15:38:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qr1GKvJa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51FF92073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18166-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 26570 invoked by uid 550); 24 Mar 2020 15:37:22 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 26416 invoked from network); 24 Mar 2020 15:37:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585064240; bh=NCj3N5oBB6pG2895MeRz7pky+XQDlDn73NrS+bYc6AM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qr1GKvJaUyzDriW0KJU1HKC2q0FydemPOrJKXOPr5JKPucn0IzLnr3tNvkXG4/viU Utvi7LQHj9CsXJmlKMv/38ntVIUYwpRK5Dwr8UqXIIhyOffTODRpZPdtgLTshQwmb0 5yPgVBZGdMhl8GIjxKYAl5Nf/2eRzb9jWXyEiFpM= From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , 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: [RFC PATCH 12/21] list: Poison ->next pointer for non-RCU deletion of 'hlist_nulls_node' Date: Tue, 24 Mar 2020 15:36:34 +0000 Message-Id: <20200324153643.15527-13-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324153643.15527-1-will@kernel.org> References: <20200324153643.15527-1-will@kernel.org> MIME-Version: 1.0 hlist_nulls_del() is used for non-RCU deletion of an 'hlist_nulls_node' and so we can safely poison the ->next pointer without having to worry about concurrent readers, just like we do for other non-RCU list deletion primitives Cc: Paul E. McKenney Cc: Peter Zijlstra Signed-off-by: Will Deacon Reviewed-by: Paul E. McKenney --- include/linux/list_nulls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index fd154ceb5b0d..48f33ae16381 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h @@ -99,6 +99,7 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) static inline void hlist_nulls_del(struct hlist_nulls_node *n) { __hlist_nulls_del(n); + n->next = LIST_POISON1; n->pprev = LIST_POISON2; }