Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3593110pxv; Mon, 28 Jun 2021 08:09:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSfCPzlnbU6avCs0BM21+BUnUdv2B2eciaTcLTCxKIfYHTCSV/aYgyYejljlNJQR3Efn5R X-Received: by 2002:a05:6e02:e0e:: with SMTP id a14mr18254184ilk.294.1624892966533; Mon, 28 Jun 2021 08:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624892966; cv=none; d=google.com; s=arc-20160816; b=jdxbjYiS/6TUciJ50e4i4izxGojI0lKINDmhWyDiyiPmfL2/QFhlZ8r2/wTxbuwpJg TD0VyzBKetuyC5aIjoEFqZaQpJvGdejH5BV/RYBy/bwke9PqvKq/1n76hMbyy6a0giAP 22OdLwM276Gib1TZ1nP+K7ZoZRvtZkp8IRgUE8WXaEhSLqkrcv29iMjpBPKFUcaJI451 BllYyCJa/ZDp3DixdgUjAOBo23S7a/VpMCrKtLi/zwZ6GhYsRQ/NinNfL9CZTsgO0ezc HMgGzCWO4slvx38Fx5vzgjvKBgMw9CM2DvHtQDFEZS0QnaKNpYY8G6A9MKO04/+edzx7 u0pQ== 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=iAb0NocR+rT1NjF9zavPpfxs5o4hLFCAfoDytKG2URg=; b=yIWjeVDuSs5RyLBdBkAD8bwLyKGkavRGUSgVEJhFZa7qSnK7L5pCF8O0uis5QmSBwd OUnpjLeUzr+5uw2owU1dFf3m39xw8mY33mOQPYtOQ6K0VhhxUhLmcXSaNp4Idv8BBxy1 vJ843TpXo55Qisr+V2Fq+PueEVyr01xMMflIKqfBnW95qtTdAfVkGyZBZl8wbc13EDNH zJvuLqmZptbzOkGA+yV00pSsKmz954ZcHO3H7a+hEuF41BrIyfZ07u+VCFx5C5VfbFKf KBWc8pT9mt7eF41PZiLWxsP7QIExXfh9InvWyE5Q02iRTMWSS553Fi4r5fYtkxg1nXf0 l8/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Usz30SHh; 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 a4si5470625ilj.44.2021.06.28.08.09.11; Mon, 28 Jun 2021 08:09:26 -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=Usz30SHh; 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 S237534AbhF1PJq (ORCPT + 99 others); Mon, 28 Jun 2021 11:09:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234265AbhF1OtC (ORCPT ); Mon, 28 Jun 2021 10:49:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B3F361D0C; Mon, 28 Jun 2021 14:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891010; bh=yQdECQzGbZ+M6ZCL3Cdt8cl9/8DxbVJxr8jH26zi5bM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Usz30SHh0ToAKoigobY487c7AWPtOPI2WEiUolWfZGBXU2NqAKoVUNsjaBM264d8+ ct/dNvwek7IkkmNSujTCjAQqnJzLvN4UOScHmtTqoo7qxknlUqQWoEUNoBjmuyeo0B 5t3SKzHtMyLb7XdW2dqCNJerVmB6BA/A2oAJJj0tc4z2HsSqEZiz3xKUQVVUhA64r9 ZlG36SAHGkMABS59r+Ti1kxPHpc09T6QFCgkXoJHjfYSbTyY8l1YT5lkugS5tbAAI5 MDXDMOwmlOuxFIDYB0yxYJYqVNdiAFBuMDqSbU7tKNLU1SZXzj1SGo+2Irihg+0Cp1 Jq7lrxETRXHsg== 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.14 22/88] batman-adv: Avoid WARN_ON timing related checks Date: Mon, 28 Jun 2021 10:35:22 -0400 Message-Id: <20210628143628.33342-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143628.33342-1-sashal@kernel.org> References: <20210628143628.33342-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.238-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.238-rc1 X-KernelTest-Deadline: 2021-06-30T14:36+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 7a723e124dbb..3ec16c48e768 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -585,8 +585,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