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,USER_AGENT_GIT autolearn=unavailable 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 4E434C4332E for ; Thu, 19 Mar 2020 13:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BC3E20789 for ; Thu, 19 Mar 2020 13:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623584; bh=r1ArD9mjzCiyxRrZZath0sRKbnKgk5N6rmHiLKxfqZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jR/fSfSmajVqZCScUVEnZYHZl7oiwf+drxxF7wTs2CDN7v6Y8+q2oWuCWRgDXLmZr 1OiU0AnFCHVKqEFNUovxVYRwT79ZLr549YWWDZFS2XiThxJ+k+HHAhEQ3o6CSJPYoF udshZ3uUu3RHZH7KRjtxpLAs7/xtQqlapoIFdmQo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729064AbgCSNNC (ORCPT ); Thu, 19 Mar 2020 09:13:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:59494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729034AbgCSNM4 (ORCPT ); Thu, 19 Mar 2020 09:12:56 -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 843C721556; Thu, 19 Mar 2020 13:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623576; bh=r1ArD9mjzCiyxRrZZath0sRKbnKgk5N6rmHiLKxfqZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aj30V/U9lUvjHXd2aii0/TjAy4jbdvV5oIXIrVhkIouWksEwUXcFcPbU2MOnqGJXQ o53A9imY/tnK6WOn8JCDw065qEabmFCTSI3OeQ3hJBmzs5iINapkFN1Z3Ys97L70Eh HonB14WS1uqySQpYyzcF/xyy56AaCWRYxDyOQx5k= 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.9 74/90] batman-adv: Dont schedule OGM for disabled interface Date: Thu, 19 Mar 2020 14:00:36 +0100 Message-Id: <20200319123951.301775876@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123928.635114118@linuxfoundation.org> References: <20200319123928.635114118@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: 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 @@ -969,6 +969,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; + /* the interface gets activated here to avoid race conditions between * the moment of activating the interface in * hardif_activate_interface() where the originator mac is set and