Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1193635ybf; Thu, 27 Feb 2020 06:36:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwsLgUWSztKNQ+rPmHHg0DtQ5zXvQll1wa6KtynBu1AB6UKb1OCIIZzHWv5W9ObBoAQymXI X-Received: by 2002:a05:6830:4cd:: with SMTP id s13mr3537301otd.181.1582814210773; Thu, 27 Feb 2020 06:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582814210; cv=none; d=google.com; s=arc-20160816; b=tUeGZzEB0+DU/tXom+6b//KoaMJoSts448mKgPFOoocp1EZRS7P1Hopi1Zcpp0HOTX AkNVS/Zc+XEdkM2tWj+Y9rPkvfAM1t3XMfTgGIxaK9+NODyWd921rDezJeJeuj7rOSL1 hwbr8MxDEUlG4cc/1LH4Z3cTWp3Acc4qqV2r8cDAkrVDMFZz0Kkhq7dZGMG+bZwfHzEr vXVY3yfwJN6+r/MTdeoQErFoKj2glOE8bTGxcTtcZuVaBYP+p/59JOep5EMR3ZHaaL2p W/jN6CkKWF6305XHDN4XjGW/WAV0PLYc2WRO8xo4XI+6HerIZoAxkFDk2nNpEYtAjMZA VOgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=GXQQGCUDx6/ypnxyYBLNMsL8fniyedPKL9bp1cdNkyE=; b=YOnto7czTPoIl4VDRYCEHpCsZWu6Sl8wEvvGCrF7KwfWAmKZkFMOT6HOQoh87OmdKG BNY6GfUTPPI52iEO3TXa21RxwZwC+KVxAutoB46MguI2QypWqZVyD1ceaVWRQQm/tAqG zlpYV+dW0Y8p+V3MVcrWOzxkcplg5dxk9j4N5z4kubLuYkrjlXt6L+HeysqKt6tFrIAS MgMbDF0N2ynMm2eIWm4+6UYh5A8FJeAsrMDOnDWl5P34IMzmnf+D0V8QafzY0tmhamD/ 67iQjzHoqTZYmMZbmsmLcGT5/eT9XGFRO1RzgafpjWsP4Zk24r1mRMNr4cVPL5/z/mnm NvbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VrPHTq5P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si1476345oti.22.2020.02.27.06.36.38; Thu, 27 Feb 2020 06:36:50 -0800 (PST) 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=VrPHTq5P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389065AbgB0Ofu (ORCPT + 99 others); Thu, 27 Feb 2020 09:35:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:44916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733156AbgB0Od5 (ORCPT ); Thu, 27 Feb 2020 09:33:57 -0500 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 269F624697; Thu, 27 Feb 2020 14:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582814036; bh=rXX4baJBpVmsrJ1apwr5q2LcKvq7w9ypzd3klZbEYG4=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=VrPHTq5P1qoilg+HMyyH0zcQXSYfoYZ9ddHf/82/nI2n89Ux8RHTPipPS0YvC/AMW Ah8MmoemZDf0hzFJ/IWwNQ1OQGF9XW7LPJoX/Hy92nSbaXp9aNI28ZnS2TIRCSLVTn tVmmxr03qDzYs6nMbkx58oNMQ2LaUkBCNlBBdpww= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi Subject: [PATCH RT 01/23] Fix wrong-variable use in irq_set_affinity_notifier Date: Thu, 27 Feb 2020 08:33:12 -0600 Message-Id: <3e96d7fce5c890b243bd194810f1675bbcadf253.1582814004.git.zanussi@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joe Korty v4.14.170-rt75-rc2 stable review patch. If anyone has any objections, please let me know. ----------- [ Fixes upstream commit 3e4242082f0384311f15ab9c93e2620268c6257f, which erroneously switched old_notify->work to notify->work when fixing a merge conflict ] 4.14-rt: Fix wrong-variable use in irq_set_affinity_notifier. The bug was introduced in the 4.14-rt patch 0461-genirq-Handle-missing-work_struct-in-irq_set_affinit.patch The symptom is a NULL pointer panic in the i40e driver on system shutdown. Rebooting. BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 IP: __kthread_cancel_work_sync+0x12/0xa0 CPU: 15 PID: 6274 Comm: reboot Not tainted 4.14.155-rt70-RedHawk-8.0.2-prt-trace #1 task: ffff9ef0d1a58000 task.stack: ffffbe540c038000 RIP: 0010:__kthread_cancel_work_sync+0x12/0xa0 RSP: 0018:ffffbe540c03bbd8 EFLAGS: 00010296 RAX: 0000084000000020 RBX: 0000000000000000 RCX: 0000000000000034 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000008 RBP: ffffbe540c03bc00 R08: ffff9ee8ccdc3800 R09: ffff9ef0d8c0c000 R10: ffff9ef0d8c0c028 R11: 0000000000000040 R12: ffff9ee8ccdc3800 R13: 0000000000000000 R14: ffff9ee8ccdc3960 R15: 0000000000000074 FS: 00007ffff7fcf380(0000) GS:ffff9ef0ffdc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000020 CR3: 000000104b428003 CR4: 00000000005606e0 DR0: 00000000006040e0 DR1: 00000000006040e8 DR2: 00000000006040f0 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Call Trace: kthread_cancel_work_sync+0xb/0x10 irq_set_affinity_notifier+0x8e/0xc0 i40e_vsi_free_irq+0xbc/0x230 [i40e] i40e_vsi_close+0x24/0xa0 [i40e] i40e_close+0x10/0x20 [i40e] i40e_quiesce_vsi.part.40+0x30/0x40 [i40e] i40e_pf_quiesce_all_vsi.isra.41+0x34/0x50 [i40e] i40e_prep_for_reset+0x67/0x110 [i40e] i40e_shutdown+0x39/0x220 [i40e] pci_device_shutdown+0x2b/0x50 device_shutdown+0x147/0x1f0 kernel_restart_prepare+0x71/0x74 kernel_restart+0xd/0x4e SyS_reboot.cold.1+0x9/0x34 do_syscall_64+0x7c/0x150 4.19-rt and above do not have this problem due to a refactoring. Signed-off-by: Joe Korty Signed-off-by: Tom Zanussi --- kernel/irq/manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 071691963f7b..12702d48aaa3 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -353,7 +353,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) if (old_notify) { #ifdef CONFIG_PREEMPT_RT_BASE - kthread_cancel_work_sync(¬ify->work); + kthread_cancel_work_sync(&old_notify->work); #else cancel_work_sync(&old_notify->work); #endif -- 2.14.1