Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2099973pxb; Fri, 22 Oct 2021 14:00:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Su/b9XKrSyHR0+Yj0MqpBdAn0HtZs/woLScwhMx5PEtevIFmH6uDx4FXcys1i/FhQUly X-Received: by 2002:a17:907:e9f:: with SMTP id ho31mr2443976ejc.156.1634936424176; Fri, 22 Oct 2021 14:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634936424; cv=none; d=google.com; s=arc-20160816; b=FUmP1bOJa2tLa2P4yTuyJJDwmuzInz1Syd3+b18K4RhDa7IxhCgDVj8M5zVztCPNC7 8NUqEke7fY0PUtjdYHxgadJPsgU75LvpdbT9948AQZ+/V9lSBBpYp6s0W1iwXLvFGuSo GJcOO9HYaMfNrxiO0HCiAML2h5320BE+hgeugtXA18ioFBxOR49aBsCHkvJRNa6CUhrf gP1kPT+TD5gxlbIjHTUFnGzI3Xt3/PL8J4iQvd2qWasjl7RutgbJvOM+m1b1EFK59WM1 RylbucLsaCja7bKypT+zTPxLLhCRtWWxkd0m97h+JKW2Xd8TqORxOtZahJfOtc4VPj7x soyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=DvZRyK8W4taoJI0w6BsZtI1Rsk5Ek0pe9nbSOny/XQk=; b=NNAFBraQxGToHtT69MZFZfkSH4a7u1L3/7uO1iV0V0foddNWbGleoy996vaDOACnWZ edwE80ktsZiT8H5SLeMfBho/glYQVvkScO1zkb6OuH29J3Zk+kFK3zflaymvyb70SSv6 /XMc7m0c0o8wgTRtK4Di9BqboGk4brRSHSY5RyZWBF6sMS1hw6Ok5D9UlBj2cSU/OSKP JY/YX/64xtXwC64OvLsumm1m3et3nszg3dY03kCUuWsAlJ26Gl0BAvEu9Sgpui4hJvHr v8RGwdhjmmh7Nh9/96eovAJoPUXc3Z70BPfu+ZHy8bm6mU9Ci7J5QH52NDOqJ3AZEvF1 vnZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="ez4gPpN/"; 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 hp24si18733130ejc.400.2021.10.22.14.00.00; Fri, 22 Oct 2021 14:00:24 -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="ez4gPpN/"; 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 S234395AbhJVVAh (ORCPT + 99 others); Fri, 22 Oct 2021 17:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234336AbhJVVAg (ORCPT ); Fri, 22 Oct 2021 17:00:36 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E235AC061764; Fri, 22 Oct 2021 13:58:17 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id j21so11674674lfe.0; Fri, 22 Oct 2021 13:58: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 :from:to:references:in-reply-to; bh=DvZRyK8W4taoJI0w6BsZtI1Rsk5Ek0pe9nbSOny/XQk=; b=ez4gPpN/IOR6H0XxlZCC1Rb4J+1SYLTTIYzHc3i8NDdOz+jcagq/G2sF1SkQ281m4y xeL9LKXQqZKeI99HmADhMqlRewoNQYwjo4qyB3xQIw3E5pkmmKop9/HrBW2+nZEAkZHp GO7R+Wo/DIpCJgAJdQMhxAtoPyJhipDRyEWIiERGFxn52pvPswhe+jVjGDai8N+fNzYU CAoPkwigyl13PukTRVuIbihfzdrromlY4ArIwmPvFscRioWlWkf5xmDpZ3lXk6ut8vGQ Dno9T1ftluLFnrt8Jls13D8VnK3nkNhYSiCrQa9BKL1ejNocJh8TIv2ZR+rKH9p2Q2yL qNkA== 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:from:to:references:in-reply-to; bh=DvZRyK8W4taoJI0w6BsZtI1Rsk5Ek0pe9nbSOny/XQk=; b=25YlWE1ea3pjwseyAYqjk0fJB8V5EAJqPZZhnvqDSj2AbXpEKpqiUsJZRy/IEXMoCb TkwpfR0IlokVagdQ682FsIKmR0+ofKrzHZkFVf5VkMsLWeHeT9AlVTUUNgVMX2pqDvyZ VeKkGg4W8dgCTMMGqzPzo4EhqP6ODFOSoirY8PZz9Cbd1yAvT7jVJ3Zg1UnqgIm1INpk hCdeBqYVEagWJB2Le3QDJX14aUXUbEpdMhTMvhVpiQcvpFGK2Kh+f75HSuZ7anhPLozq HdwiVn2snVJEquTC/tqQpB3tjIzeEKo6i3g7ZimLJkjFogqoQLUnP2R/3WDQKgkR0D3Z v2Ig== X-Gm-Message-State: AOAM5315QyRl31/kaRoVxABMqj3JqwjjFDssmeP+hqcvqr+/qqaiSM4m EPSVvLpimzV/GJoEW2j2mWo= X-Received: by 2002:a05:6512:3501:: with SMTP id h1mr1879903lfs.235.1634936296265; Fri, 22 Oct 2021 13:58:16 -0700 (PDT) Received: from [192.168.1.11] ([94.103.235.181]) by smtp.gmail.com with ESMTPSA id l4sm995215ljc.133.2021.10.22.13.58.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Oct 2021 13:58:15 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------CvkaH0ihFkENdKmg5e7QlCGq" Message-ID: <5e29e63c-d2b5-ae72-0e33-5a22e727be3c@gmail.com> Date: Fri, 22 Oct 2021 23:58:15 +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 From: Pavel Skripkin 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> <1639fcba-e543-e071-f17c-941b8c7a948f@gmail.com> In-Reply-To: <1639fcba-e543-e071-f17c-941b8c7a948f@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------CvkaH0ihFkENdKmg5e7QlCGq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/22/21 23:57, Pavel Skripkin wrote: > 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 > > > > Whooops.... Forgot to ask syzbot to test the patch #syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master With regards, Pavel Skripkin --------------CvkaH0ihFkENdKmg5e7QlCGq Content-Type: text/plain; charset=UTF-8; name="ph" Content-Disposition: attachment; filename="ph" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL25ldC9iYXRtYW4tYWR2L2JyaWRnZV9sb29wX2F2b2lkYW5jZS5jIGIv bmV0L2JhdG1hbi1hZHYvYnJpZGdlX2xvb3BfYXZvaWRhbmNlLmMKaW5kZXggMTY2OTc0NDMw NGM1Li4xNzY4Nzg0OGRhZWMgMTAwNjQ0Ci0tLSBhL25ldC9iYXRtYW4tYWR2L2JyaWRnZV9s b29wX2F2b2lkYW5jZS5jCisrKyBiL25ldC9iYXRtYW4tYWR2L2JyaWRnZV9sb29wX2F2b2lk YW5jZS5jCkBAIC0xNTYwLDEwICsxNTYwLDE0IEBAIGludCBiYXRhZHZfYmxhX2luaXQoc3Ry dWN0IGJhdGFkdl9wcml2ICpiYXRfcHJpdikKIAkJcmV0dXJuIDA7CiAKIAliYXRfcHJpdi0+ YmxhLmNsYWltX2hhc2ggPSBiYXRhZHZfaGFzaF9uZXcoMTI4KTsKLQliYXRfcHJpdi0+Ymxh LmJhY2tib25lX2hhc2ggPSBiYXRhZHZfaGFzaF9uZXcoMzIpOworCWlmICghYmF0X3ByaXYt PmJsYS5jbGFpbV9oYXNoKQorCQlyZXR1cm4gLUVOT01FTTsKIAotCWlmICghYmF0X3ByaXYt PmJsYS5jbGFpbV9oYXNoIHx8ICFiYXRfcHJpdi0+YmxhLmJhY2tib25lX2hhc2gpCisJYmF0 X3ByaXYtPmJsYS5iYWNrYm9uZV9oYXNoID0gYmF0YWR2X2hhc2hfbmV3KDMyKTsKKwlpZiAo IWJhdF9wcml2LT5ibGEuYmFja2JvbmVfaGFzaCkgeworCQliYXRhZHZfaGFzaF9kZXN0cm95 KGJhdF9wcml2LT5ibGEuY2xhaW1faGFzaCk7C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