Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2099336pxb; Fri, 22 Oct 2021 13:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkCgrhDdqVWhx1jzj4yE+tQ8r+PayPne4FS7/LqiIrfW3epE5zj3xjhjRw1ks2f8vtbexu X-Received: by 2002:aa7:db0a:: with SMTP id t10mr3200022eds.180.1634936374518; Fri, 22 Oct 2021 13:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634936374; cv=none; d=google.com; s=arc-20160816; b=VBXHb0EDORqAC8vzCWyVk7QuaKFORyp2E6rPFa6yO6gliLLxFut1n4LL4MHkX4pRMx tFRbGkdpP+kZSup+gsZi0l+4GN410yfjCvXENOSQb0xOG/Grfyq+qgIZtd6GnScs34rT GMa8oKT7OQw0Wbp1WfQhwwSzoD4dUJwPm/lxoEt7w6j7xY1LYa0uE/67W+Cy4fmH/2sq jWBUOL16ZQMqCzucURE1aLSlMtoRymQ8ysQ+Leld7bxF5Qi7VHHCdbWZwAZTCaEUB/Su wZxSq1gyuIvbndwC+C32HflPIcgFV6vdmOyp8prxJgAwF5u/cTfN2eTCO8h70XnMm9H4 Q+Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:to:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=/2Oyx3gtUUIUVbpFEL+V2b/0RPstg82IKKmaTuTPF5M=; b=wtmr2MNClGThourOA1YqEe5Gl/qpMQpLAhPobgomn9rvnnwdNOPqfWtlPLZnXg12t5 ojymU7iQ69atBqo6qcd9NXFVSTZWVwqaBZUB5+6NlMfa1Q21X4Ze6LpvDybX8ydD8qSE gfKtBqodk3dYk2wNvxjQR4sPACV03Sa29wtbOL384tH89ZDiOAc2g8SsxwWD/IT84cbd M7TowZn3dYKa4yTuDY120rHZvcTP8MC9q5sPMCej+J77FT9uTv28nJUPLc3tYyIamrx7 hivQLDNpGdb/8omOlKLJK7bOJ0vo88BQAbirSfaHc97SMg1RVSO8AAI5hYilsXlS6hkN h0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XxKnOMpx; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 2si13841670ejl.713.2021.10.22.13.59.10; Fri, 22 Oct 2021 13:59:34 -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=@gmail.com header.s=20210112 header.b=XxKnOMpx; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234315AbhJVU7h (ORCPT + 99 others); Fri, 22 Oct 2021 16:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbhJVU7g (ORCPT ); Fri, 22 Oct 2021 16:59:36 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10869C061764; Fri, 22 Oct 2021 13:57:18 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id o11so4439131ljg.10; Fri, 22 Oct 2021 13:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=/2Oyx3gtUUIUVbpFEL+V2b/0RPstg82IKKmaTuTPF5M=; b=XxKnOMpxXJvFfeTn4AT3QvMuXQ6NfP8Fkj5P01SZraLEXMOMhgkNmjBEr38AgqP87l ggmwm9k2sTRECttFpJZucPOuq/jlzPGr2q0Y6wSKanvppW5YbQFHlsnG3yb5LIQvpe2k txNoRL7mxnnruWP30TS0X8waG9IqgzNBcCWHHRuNLHZrkfnV3WtwuPWkN51p1C+/JYGb Zhe+adLbWnSR6M7MhTYDcr+nMLQ/S4emqAjdm7vw56d2ibt+RwSG3qtJ0XhDLU2BynS1 T2exY/IHKbwTQ+QkBhftnGLPXC8IRjzlX1+bI9r6/w3CYVrXCUvyW4MDcN8g7pdbjnLA kAtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=/2Oyx3gtUUIUVbpFEL+V2b/0RPstg82IKKmaTuTPF5M=; b=5nGb97c3nhjXtreuFOcOPj5QgVyK14koAMzpLyr6t0iR83X8gDsTh6H9g+VAnwahUh /y0zT/hGufN99+99fI8Ptzyq5n9fnyinaphG3T3KxCgLgX9Rlv7lxpyOJRKyn8abFpic ClPauGoQDyOH3xGcuaAtvvxA0M4Ued+nWJeNgZq28OFGqPSviAxksFDmvebXVs0CJOqg m4kddTrn4+Sw8ptoRUOBiSQ5vv1s4Pqz2HRQnP803g4W4MRVrbnqdInnJDQk958x29pr wTOf+Ph7V36xZIZFlvwDb1S8mGUbXWHqlriUN7nLeN+qd55pLwGghRFr/Rrf1SS9oBx/ 3ihw== X-Gm-Message-State: AOAM533pCglD568+Qib+OKapoaSYkcgwJh66WoY5pJqG+JUtbWBb/uFE gMhAb04MjoJazNRVBSGh8sEKegRFZf6Pww== X-Received: by 2002:a2e:760d:: with SMTP id r13mr2277581ljc.355.1634936236326; Fri, 22 Oct 2021 13:57:16 -0700 (PDT) Received: from [192.168.1.11] ([94.103.235.181]) by smtp.gmail.com with ESMTPSA id a16sm966763ljk.100.2021.10.22.13.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Oct 2021 13:57:15 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------XP0ezmYVfmtBDjzAIPdDrp9W" Message-ID: <1639fcba-e543-e071-f17c-941b8c7a948f@gmail.com> Date: Fri, 22 Oct 2021 23:57:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [syzbot] WARNING in batadv_nc_mesh_free Content-Language: en-US To: syzbot , a@unstable.cc, b.a.t.m.a.n@lists.open-mesh.org, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, mareklindner@neomailbox.ch, netdev@vger.kernel.org, sven@narfation.org, sw@simonwunderlich.de, syzkaller-bugs@googlegroups.com References: <000000000000c87fbd05cef6bcb0@google.com> From: Pavel Skripkin In-Reply-To: <000000000000c87fbd05cef6bcb0@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------XP0ezmYVfmtBDjzAIPdDrp9W Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/22/21 23:20, syzbot wrote: > Hello, > > syzbot has tested the proposed patch but the reproducer is still triggering an issue: > general protection fault in batadv_nc_purge_paths Oh, ok. Next clean up call in batadv_nc_mesh_free() caused GPF, since fields are not initialized. Let's try to clean up one by one and do not break dependencies. Quite ugly one, but idea is correct, I guess Also, make each *_init() call clean up all allocated stuff to not call corresponding *_free() on error handling path, since it introduces problems, as syzbot reported With regards, Pavel Skripkin --------------XP0ezmYVfmtBDjzAIPdDrp9W Content-Type: text/plain; charset=UTF-8; name="ph" Content-Disposition: attachment; filename="ph" Content-Transfer-Encoding: base64 Z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