Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3777440pxv; Mon, 28 Jun 2021 12:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4VjD5K+onPLpUMmRvtTKJUBZvbEHsl6HbL+ycrtqBCkFv+4vQpj4sszEndY4JJWHekUvr X-Received: by 2002:a5e:8208:: with SMTP id l8mr817880iom.197.1624908990219; Mon, 28 Jun 2021 12:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624908990; cv=none; d=google.com; s=arc-20160816; b=bm6vUYBGVrMOZwnD1Nkj6ajhFy9pKHQc8lDaLZQSgQ2oX30vK712Gy0OJ90tcrLSnJ S++VqmPehEviES2FT7ySTHhdsZ8EUk8y0qkQTn4ANg7bRe/D236pyTaE8Zd6RNeXkbhS bMLOloL1lV+PqoQQ43EaIlvqNzgqkrh3jo8jT9HZaoGl+6wn1OWewxNbdi4WzSmJvxO4 PQmb5cqiZNShtwkWIszu7yegt0FrkljRwGz4untoza2NuciY7x1ANWqy9ey7sv7FQbrE qKuI45R5JTSl1+m7Wyq0QuRpTvnCV7+2zns3OhzfbnRv5ojNlQHjUOhudQWc1/vd3pp5 KryA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EntjTxXGIDvDxDfnuFF6RWkG1lEzWw348ShauaqxHyU=; b=07SHEUeeTEqinwPrTkmWhBoJT0kd6cbaqxcrewfJ7woG630XnM2sUK1cTEmiZUDmu9 d5VGNEnpuh+aLeYf1Axgrc671XSoit+K4eXJ9fEdGWoTNw1vG4n+wib80yyuZyc/VdLL 6UsWjdBP9BX3f27sPBDtX1f7wuDklbhPXwoEgEqMfc2O6XPpzSZkiDeFTUNJw2Ao6jVz EmEDaJ5xRqqO0Kt5Fe4XzLqkA34wYHyDvNF6SMIaV75hPzA7kJQxbqlhazS21/k88iT6 rC/xyRmGmcKr5W4Q0qxDv6oYEXppDYMpnfX3cAiQxI2/yvUUZuhotDpTzWsQ4AJpx5Vb HVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l1tQCTSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s13si4756095jaj.54.2021.06.28.12.36.17; Mon, 28 Jun 2021 12:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l1tQCTSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232790AbhF1O4s (ORCPT + 99 others); Mon, 28 Jun 2021 10:56:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:51688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234746AbhF1OmE (ORCPT ); Mon, 28 Jun 2021 10:42:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 41D2561CD6; Mon, 28 Jun 2021 14:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624890810; bh=BR66e9XFC4AveHOhq1ZTWg9m/GeNPDdI7awe2ltR84U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1tQCTSONlM+KJeUyOwJtUI2q5t+6aBxZCLRsAd6Fg6THjndyjiqgP58ZLa5+w4ID JSXbN4K2v6yZady/T5O41FUeOT8xYHhl9BNedrEW03WYAZFJxIn6D+ntXLbT8vClG0 fZj2kECuyVxRHwQeyVOx5Romxfyeb+ep8Obzb7MrZCWuFBBik7/XfsG6DFy5wHnLg1 y/pnJ3m4w4KpqqCQGKPjbe9xMJ5aWldMz0j+97ptQbOO8hlsf6vj7PS7KbVLioEYeZ PxRRyTCJ5NRXomFz8HlDjc/DfRuO5Bpnzd4ePLKEdPOGo2rjVyrngoCcYmSdwfvrAC ae4NNqFfnl8kA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sven Eckelmann , Tetsuo Handa , syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com, Simon Wunderlich , Sasha Levin Subject: [PATCH 4.19 026/109] batman-adv: Avoid WARN_ON timing related checks Date: Mon, 28 Jun 2021 10:31:42 -0400 Message-Id: <20210628143305.32978-27-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143305.32978-1-sashal@kernel.org> References: <20210628143305.32978-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.196-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.196-rc1 X-KernelTest-Deadline: 2021-06-30T14:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Eckelmann [ Upstream commit 9f460ae31c4435fd022c443a6029352217a16ac1 ] The soft/batadv interface for a queued OGM can be changed during the time the OGM was queued for transmission and when the OGM is actually transmitted by the worker. But WARN_ON must be used to denote kernel bugs and not to print simple warnings. A warning can simply be printed using pr_warn. Reported-by: Tetsuo Handa Reported-by: syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com Fixes: ef0a937f7a14 ("batman-adv: consider outgoing interface in OGM sending") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin --- net/batman-adv/bat_iv_ogm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 0b052ff51bde..cede6826e5b3 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -594,8 +594,10 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) if (WARN_ON(!forw_packet->if_outgoing)) return; - if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface)) + if (forw_packet->if_outgoing->soft_iface != soft_iface) { + pr_warn("%s: soft interface switch for queued OGM\n", __func__); return; + } if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE) return; -- 2.30.2