From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63912C4332E for ; Thu, 19 Mar 2020 13:08:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C20421655 for ; Thu, 19 Mar 2020 13:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623338; bh=wOxoSKoBYaXoDbRzYnXeW5ePbgwzTF8u6cjic2D4jGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cdYbh6h0CYqFPiJC3VYDu8qlKuUks+cGHsoR2hzy1mRJIPuQ/zSWoH9cJ7OhwuhO+ DnRKK5hNq7ZYOBs8hzV1rSBXC8112DH7J9wlvZJyLK08ZV4MuXfeR9f3csn1XTmPm7 ZMjUO6ukJIIuMpeF/g2+dnRgh03msqyZhJkm+/7o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728228AbgCSNI4 (ORCPT ); Thu, 19 Mar 2020 09:08:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:53194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbgCSNIx (ORCPT ); Thu, 19 Mar 2020 09:08:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5C28212CC; Thu, 19 Mar 2020 13:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623333; bh=wOxoSKoBYaXoDbRzYnXeW5ePbgwzTF8u6cjic2D4jGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RkuEyR/YdenX3yDQ/v0BwhlgEJ8CRRt9qoIDgpnlps/za95yOJ1HmkrWLLTo2knMq hyoXO1z2tP74CWlDFDHbApVGvxnKk8eeJCR8AZa4wGdhucHoEW9MW7LbvSre0wA/ZD Ru6KpRH3q4IXrTHmOWabVvJAc2nM15ZPhs30vWFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , syzbot+a98f2016f40b9cd3818a@syzkaller.appspotmail.com, syzbot+ac36b6a33c28a491e929@syzkaller.appspotmail.com, Sven Eckelmann , Hillf Danton , Simon Wunderlich Subject: [PATCH 4.4 85/93] batman-adv: Dont schedule OGM for disabled interface Date: Thu, 19 Mar 2020 14:00:29 +0100 Message-Id: <20200319123951.445806441@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123924.795019515@linuxfoundation.org> References: <20200319123924.795019515@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Eckelmann A transmission scheduling for an interface which is currently dropped by batadv_iv_ogm_iface_disable could still be in progress. The B.A.T.M.A.N. V is simply cancelling the workqueue item in an synchronous way but this is not possible with B.A.T.M.A.N. IV because the OGM submissions are intertwined. Instead it has to stop submitting the OGM when it detect that the buffer pointer is set to NULL. Reported-by: syzbot+a98f2016f40b9cd3818a@syzkaller.appspotmail.com Reported-by: syzbot+ac36b6a33c28a491e929@syzkaller.appspotmail.com Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Signed-off-by: Sven Eckelmann Cc: Hillf Danton Signed-off-by: Simon Wunderlich Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/bat_iv_ogm.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -944,6 +944,10 @@ static void batadv_iv_ogm_schedule_buff( lockdep_assert_held(&hard_iface->bat_iv.ogm_buff_mutex); + /* interface already disabled by batadv_iv_ogm_iface_disable */ + if (!*ogm_buff) + return; + primary_if = batadv_primary_if_get_selected(bat_priv); if (hard_iface == primary_if) {