Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2094158lqb; Mon, 27 May 2024 07:42:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLL75S6ARbohCkmrSHSJ7vLFjbIxN5srTXaJYUcOporsH7i0eEK6PT+SBbFS5uWWrjdn3lbiMQfm59MRYnCXoJYJNxn33Pher/Uy7+Ig== X-Google-Smtp-Source: AGHT+IEcMMWJsGFtdzg7mNsuN6yhltq9q/drB+LJK9BEQpWpJa3v92+jHhGxnNCaNkHWOxarum0w X-Received: by 2002:a50:9343:0:b0:579:e7c5:1001 with SMTP id 4fb4d7f45d1cf-579e7c51a1cmr245099a12.23.1716820939063; Mon, 27 May 2024 07:42:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716820939; cv=pass; d=google.com; s=arc-20160816; b=wgn3oK13DPtth1zxBzA9Y6nYMzkiL3RHSFv7aE37Ws4/Ifk6sBQ0r8eWxnsTLplz4s Gc4mbK58A23mnP0lJjUIfpxrA2dXx09SxctjgXo5RGrYWD+dyvQ4MFRHsU+LXLrzdKnS LpoUONmaGti9Ta9HroXjCY3XaDvg2dKnz6tks4oraWF187kXH7PBfN6pKH+73l9sRTT1 NYZPNI3O09+OW4dse/nYLDu9QCirto8sBNRrypqDRFRiwQLnI5WtwRxMKCCXwbz9WIl0 0TEtZwF/XM+XlJ38uaxZ9fBZ6D5Kqm0wpdGW0vVClcCZuSiD4yuxV4AE6WzK0ZiOSWVo z9jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KgZbR9D416vUIcSbhiVV3xkmxVuSAWrTGb6DHbBTPi0=; fh=UTGmxblxmUMA2BBRb6B4cWLUwnstfkqlhgthPacsewo=; b=qwgJF7Rp82zmKgHBYwIrkphuZAXzeRXW4Jz/fqsrEFvWn8SOKK14K/m/OT7gsKMi6t Ups0czG5qxGCQn8RUBw+SMQ11qZqJipOczk1K+91mhMJYaoDgHPKDPqfFnIipJj5P9pF uWIzhsMiOnpsjgnK8NC4w1FjRwTheR39/eC/bwSINqE9wp1LffqugjTj/9m4RmIqayoU iwNItMnbdmSm9drsAamoH+Q0dywETPWnvro7Q7RNSDyFumYP4HS9pSDJZ7YAgZaHtjKb 7lUD0SHvba+1iVuL6lh2RfQv1J5+vHQLYqh0CWfG3deQCRSuMIZAcbNlJ1/8NhGAuQn8 57lA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DXDbyJC4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5786cf94f58si2743382a12.183.2024.05.27.07.42.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DXDbyJC4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 974361F226FF for ; Mon, 27 May 2024 14:42:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0A1321C160; Mon, 27 May 2024 14:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DXDbyJC4" 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 EBBFD2101A4; Mon, 27 May 2024 14:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819507; cv=none; b=R5CfNTwp6h72Q7OQuVavx/+m6gnRIqQgMREAsLOQrHrM0fmCNxaY/kPQp3Ez6JeNzTDphKmMTQNBs+ANXZJPqUN3OBytoxX4bGsZrXZNFS+wtjB7tTMK5ncGm3kIMoj1UjmFrV/XjdqWRMaJVq0sAQs/XRQTyVBPytRVE3tLUds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819507; c=relaxed/simple; bh=wWlaba575eancS3/0Cb++JDEelrHH0yJRBg2wqbox/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uIusDmbrLNt5n/vPy+XCeOgpLdp4SHqKCIx2+T9LlDvrCZOMKEW+6EkitIS3Q8jLNJ7COOsXEyusvjC5gmA5fRUOrfwCvuKSomKfr0uf12agny6bqwBfWirHEL0CKxwRsT8gNJCsFt62Ov+6MYuiMz9LI0x0meSxn5/dCbE1fg4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DXDbyJC4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63503C32789; Mon, 27 May 2024 14:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716819506; bh=wWlaba575eancS3/0Cb++JDEelrHH0yJRBg2wqbox/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DXDbyJC48ZAw2UuJO0bUkkO36f8CMonLadSFjqnb6IUb2x7mrG0YY/pT1FCPpn8Q5 IS4KiKFZPOf6JwYX3xe+rURIizySTIk06Qa1/mC3L7AXl5OjumD6cRMzEGsW5zhURR nHo0lJ03KVOYFrRgkA86PDg+WpdbIUw97U3H8mxjMvJecmWCj+JG2CY+HxfkD/rdNn S06fCjm+icainSg4ww3IroRs2zhHKDjMFSiZmqovowYrOkKGs/5zbwFslQ/6o2SoFS +684/J5T5WpVZMhy+WsLkReFROPm4XfpDbqhwxwZf3h4d+7DiZz4esGzkNYXCRgyuM M71E77NJ6kbIg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eric Dumazet , Sven Eckelmann , Simon Wunderlich , Sasha Levin , mareklindner@neomailbox.ch, a@unstable.cc, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 03/13] batman-adv: bypass empty buckets in batadv_purge_orig_ref() Date: Mon, 27 May 2024 10:17:57 -0400 Message-ID: <20240527141819.3854376-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240527141819.3854376-1-sashal@kernel.org> References: <20240527141819.3854376-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.160 Content-Transfer-Encoding: 8bit From: Eric Dumazet [ Upstream commit 40dc8ab605894acae1473e434944924a22cfaaa0 ] Many syzbot reports are pointing to soft lockups in batadv_purge_orig_ref() [1] Root cause is unknown, but we can avoid spending too much time there and perhaps get more interesting reports. [1] watchdog: BUG: soft lockup - CPU#0 stuck for 27s! [kworker/u4:6:621] Modules linked in: irq event stamp: 6182794 hardirqs last enabled at (6182793): [] __local_bh_enable_ip+0x224/0x44c kernel/softirq.c:386 hardirqs last disabled at (6182794): [] __el1_irq arch/arm64/kernel/entry-common.c:533 [inline] hardirqs last disabled at (6182794): [] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:551 softirqs last enabled at (6182792): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (6182792): [] batadv_purge_orig_ref+0x114c/0x1228 net/batman-adv/originator.c:1287 softirqs last disabled at (6182790): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (6182790): [] batadv_purge_orig_ref+0x164/0x1228 net/batman-adv/originator.c:1271 CPU: 0 PID: 621 Comm: kworker/u4:6 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: bat_events batadv_purge_orig pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : should_resched arch/arm64/include/asm/preempt.h:79 [inline] pc : __local_bh_enable_ip+0x228/0x44c kernel/softirq.c:388 lr : __local_bh_enable_ip+0x224/0x44c kernel/softirq.c:386 sp : ffff800099007970 x29: ffff800099007980 x28: 1fffe00018fce1bd x27: dfff800000000000 x26: ffff0000d2620008 x25: ffff0000c7e70de8 x24: 0000000000000001 x23: 1fffe00018e57781 x22: dfff800000000000 x21: ffff80008aab71c4 x20: ffff0001b40136c0 x19: ffff0000c72bbc08 x18: 1fffe0001a817bb0 x17: ffff800125414000 x16: ffff80008032116c x15: 0000000000000001 x14: 1fffe0001ee9d610 x13: 0000000000000000 x12: 0000000000000003 x11: 0000000000000000 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : 00000000005e5789 x7 : ffff80008aab61dc x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000006 x1 : 0000000000000080 x0 : ffff800125414000 Call trace: __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:27 [inline] arch_local_irq_enable arch/arm64/include/asm/irqflags.h:49 [inline] __local_bh_enable_ip+0x228/0x44c kernel/softirq.c:386 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x3c/0x4c kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:396 [inline] batadv_purge_orig_ref+0x114c/0x1228 net/batman-adv/originator.c:1287 batadv_purge_orig+0x20/0x70 net/batman-adv/originator.c:1300 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:51 lr : default_idle_call+0xf8/0x128 kernel/sched/idle.c:103 sp : ffff800093a17d30 x29: ffff800093a17d30 x28: dfff800000000000 x27: 1ffff00012742fb4 x26: ffff80008ec9d000 x25: 0000000000000000 x24: 0000000000000002 x23: 1ffff00011d93a74 x22: ffff80008ec9d3a0 x21: 0000000000000000 x20: ffff0000c19dbc00 x19: ffff8000802d0fd8 x18: 1fffe00036804396 x17: ffff80008ec9d000 x16: ffff8000802d089c x15: 0000000000000001 x14: 1fffe00036805f10 x13: 0000000000000000 x12: 0000000000000003 x11: 0000000000000001 x10: 0000000000000003 x9 : 0000000000000000 x8 : 00000000000ce8d1 x7 : ffff8000804609e4 x6 : 0000000000000000 x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff80008ad6aac0 x2 : 0000000000000000 x1 : ffff80008aedea60 x0 : ffff800125436000 Call trace: __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:27 [inline] arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:49 cpuidle_idle_call kernel/sched/idle.c:170 [inline] do_idle+0x1f0/0x4e8 kernel/sched/idle.c:312 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:410 secondary_start_kernel+0x198/0x1c0 arch/arm64/kernel/smp.c:272 __secondary_switched+0xb8/0xbc arch/arm64/kernel/head.S:404 Signed-off-by: Eric Dumazet Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin --- net/batman-adv/originator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index aadc653ca1d80..b6367a7576750 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -1238,6 +1238,8 @@ void batadv_purge_orig_ref(struct batadv_priv *bat_priv) /* for all origins... */ for (i = 0; i < hash->size; i++) { head = &hash->table[i]; + if (hlist_empty(head)) + continue; list_lock = &hash->list_locks[i]; spin_lock_bh(list_lock); -- 2.43.0