Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp657759ybg; Thu, 19 Mar 2020 06:32:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtQOa2ruG4s+S4t3QEstGp9L8MDiMmrleOZ4Z7GP03IYgm3LK4WAb5b9rn/ZJLt/1lL0Oeh X-Received: by 2002:aca:4d86:: with SMTP id a128mr2355561oib.96.1584624722870; Thu, 19 Mar 2020 06:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584624722; cv=none; d=google.com; s=arc-20160816; b=IlcbVsoLRskgOi4SF/Q1f9OnTK2g14yD5GqzGB+dQk1sneE7EhcoLeasudaCag2wof OL9wouFx4Doevrb+yPfFkYpLGz4dMHOHxIy6/y2Glq1bgzCTh0jud4szMH1BLDxjuB8j /wm3JEmVTIES2K4jXMe2xZOgMfAlTlVG4Sti92BU9G549ZCEQrmtObTq25tkzalf2ONU KtnF06vZMR1a1O62ysBqza14OIMvpBEHWaal24x5OZrEET8GptTSSLTAV7AOL9/Ek+Wa /fcvhtewoE6k8e9GUoPpAH7p3wdMNawWH8z0CT8jcy8pwgU/tgnpoI9aEK/7hQFc55LQ yWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PxC+NPITvNQ9CuKebeeDh3uNio0tdcO/yrMBlSHUL6Q=; b=BrT7En4vXbKaoHYgXvaehXA/kXd2bnbC6HoE9JxaC9UtOA6324n+Rlv8IWhP/pw3dO 3+JMmqWxBzqy0+ZhA69PwadbDrVkyeTyl5x30pbCL2hsqk3Dkfg6bllg+8ja6r1toGse 4WaK1xgA+RypcUz2QT4W763X61TYfRK7UBLzkcyKUTdttZjQpECFMER4NVtq/tV+Dn+G MSSztYQlrRUK0y8BwQFQHimM+uinNo7xdS+y/dGA1buwdAvEK3O8Q5Rr08MXL5yuE/hU L2vAHOebUuvm8KHv7Ynpajrzh9JY23w+ipAVcBsGhA+OeDrkBAmsWCeo+s7bG9ULyTCS 7lXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W80sBzls; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si1285597otn.249.2020.03.19.06.31.49; Thu, 19 Mar 2020 06:32:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W80sBzls; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728316AbgCSNRv (ORCPT + 99 others); Thu, 19 Mar 2020 09:17:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729700AbgCSNRr (ORCPT ); Thu, 19 Mar 2020 09:17:47 -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 4AFE220724; Thu, 19 Mar 2020 13:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623866; bh=7eiIfsE7p81DiDZxWjU7z/ijJxI8NnrOjncNXabmzYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W80sBzlsNaLddtsmukaJj0k6SxgXd2f6T/8JIanslbArs+YB7hGlKQMnJV+LFK4kl OC3J2k5QnkjUmBtF4idDqg1Z9pwuAGJFKTr8vSQBGrKg1AdGRRsGmjYe1kIEzEfcbA F5W4QL0AtFqdwG/6SR+5/RAKaKdDr2GD8ml51gH8= 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.14 81/99] batman-adv: Dont schedule OGM for disabled interface Date: Thu, 19 Mar 2020 14:03:59 +0100 Message-Id: <20200319124004.975295259@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123941.630731708@linuxfoundation.org> References: <20200319123941.630731708@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 commit 8e8ce08198de193e3d21d42e96945216e3d9ac7f upstream. 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 @@ -961,6 +961,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