Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3322rwd; Fri, 26 May 2023 14:01:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6N4NbqQeozu8zJAwig+f9KzrTYeAXQqs3r8Rz/nZbZU4h8aUEoXHg897u3GR2PqOCaRc1T X-Received: by 2002:a17:902:7c05:b0:1af:bb99:d590 with SMTP id x5-20020a1709027c0500b001afbb99d590mr3501805pll.7.1685134896796; Fri, 26 May 2023 14:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685134896; cv=none; d=google.com; s=arc-20160816; b=agKKAcxlTE+53pxdZV5bRCIISFfWCg+AVqFm/U5BzzkdpYlhxmtxfJCeYK/XudGiV4 HXWAh9KYr29Mccr+IhprKBxRM12g2c+ef1BuyHaaLOzSFI3HlPI1Pbu4CfNohBaUKjSh JoSab3NIOUjuwulXkTfbdhGjqJtWTAHyu/UukG66fvB/tiu5YJrptLq/nMDkvrXDrBJx N22eUU1kprYnI6Ft6+rob2YEu1TMxFSQdDelFNrorAr2JyGt1rlD9Qtu10yJrVuEp7XL QfX6lYBxC2IJwF/UCRjLMrfb2WrDxQ3C6vGDUnVVn0Uu1rV+7hIYpkO9UsF1vqZAEnhh AMmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nrJocbC9yujvo/q/Zvs4to1pf3VWKChUTxeNN8aTAa0=; b=0zkP/nWt2ZcOUhVoBuN2Cas4KxgUxk9n1AofmgRUf0Le54acNkyMXSG7z5/cGgkuuT JX4lRUQlfyYyaUS4DXG9FH3xqI6GrolIv5rwecxKKK7pwx9r0N79I6Fjy6A06pWj0nSH BRIzGP+PtNj9Nq7+tNvScAPUnVIn+LHJTY945u8iF6kAC7Or0hE9VTAusR37d460SrUk VfPu2WtxtNe0hZ8xdpQxVnONcTBTcTzHLxZwlIu0+XAVks6v7EJO6Q/8sPqFjAnnGfmd gg5wABM/k8Xm7fCtt/Z12XEat7hMEex8wvJDctjCiQapz6/cCLh5t4B6WONq9qWtb6tA Evlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b="I/LSxf9e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a170902c24100b001afcff6d22esi4739910plg.511.2023.05.26.14.01.21; Fri, 26 May 2023 14:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b="I/LSxf9e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbjEZUa3 (ORCPT + 99 others); Fri, 26 May 2023 16:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjEZUa1 (ORCPT ); Fri, 26 May 2023 16:30:27 -0400 Received: from dvalin.narfation.org (dvalin.narfation.org [IPv6:2a00:17d8:100::8b1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E8BE7; Fri, 26 May 2023 13:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1685133022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nrJocbC9yujvo/q/Zvs4to1pf3VWKChUTxeNN8aTAa0=; b=I/LSxf9eXH1Ikzq1flOLF5C80S7pH/0I/Jm0EFS5cz2h5bm7XpXIbRPK2L0iu7XbaFTqTq eNci93A+CRVdDUe6klTXO/tCMUkmTXTEk34RO8c3ohoKfnzOqMwP+DzxhjOBweZcZAYypG B8AS5+F3I3PkNhHN5zgPby7OKPsQst0= From: Sven Eckelmann To: Marek Lindner , Vladislav Efanov Cc: Simon Wunderlich , Antonio Quartulli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] batman-adv: Broken sync while rescheduling delayed work Date: Fri, 26 May 2023 22:30:16 +0200 Message-ID: <7526514.EvYhyI6sBW@sven-l14> In-Reply-To: <20230526161632.1460753-1-VEfanov@ispras.ru> References: <20230526161632.1460753-1-VEfanov@ispras.ru> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3740035.kQq0lBPeGt"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart3740035.kQq0lBPeGt Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann Date: Fri, 26 May 2023 22:30:16 +0200 Message-ID: <7526514.EvYhyI6sBW@sven-l14> In-Reply-To: <20230526161632.1460753-1-VEfanov@ispras.ru> References: <20230526161632.1460753-1-VEfanov@ispras.ru> MIME-Version: 1.0 On Friday, 26 May 2023 18:16:32 CEST Vladislav Efanov wrote: > Syzkaller got a lot of crashes like: > KASAN: use-after-free Write in *_timers* > > All of these crashes point to the same memory area: > > The buggy address belongs to the object at ffff88801f870000 > which belongs to the cache kmalloc-8k of size 8192 > The buggy address is located 5320 bytes inside of > 8192-byte region [ffff88801f870000, ffff88801f872000) > > This area belongs to : > batadv_priv->batadv_priv_dat->delayed_work->timer_list > > The reason for these issues is the lack of synchronization. Delayed > work (batadv_dat_purge) schedules new timer/work while the device > is being deleted. As the result new timer/delayed work is set after > cancel_delayed_work_sync() was called. So after the device is freed > the timer list contains pointer to already freed memory. > > Found by Linux Verification Center (linuxtesting.org) with syzkaller. > > Fixes: 2f1dfbe18507 ("batman-adv: Distributed ARP Table - implement local storage") > Signed-off-by: Vladislav Efanov > --- Acked-by: Sven Eckelmann Thanks, Sven --nextPart3740035.kQq0lBPeGt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmRxFtgACgkQXYcKB8Em e0ZD0RAAp8e/HTANDtMQF/tKm+CEosGlP+Hp8Aqdd8nNfTXXC2DJAouO/TO2ycmq G0N393ff6vuTkebzzuM8QqOQxFVMGCH/VDGZEkOAr+Qyq8V6Vq50uCJUyi1TkCEk lhM/wvBXJbadpikiJdkYdfJFBMUcNqRnMsmvDU3ASPw8g4/ZlTfRDKPn56UUUjb1 juIiGBWFTQ0tzcEh5p9YgrArb/jI7YkZR4BNfheFEoPZqZRkP5CaonXE436uQIjz raVe+QnxlGHVFUGpIyebNEB5/ZtWN1gsOXetqLcjFgjkwh9Qvow8tjNv13VqbTd5 rUHp8HoTwrq3UGNW3xUzRWuxJtQBOwKrNmebw2CN179C4qEZjipY14XnfGngZLyE 27QcB6s4wWz1UMjIiZ8OnN7gAzDmHKde1LqdQQp9WaAfLwFKCEeNMECg1QhQExaD vsfUr5aNuaLNk9KV/l+sus4hOCzeGCgmlUsrw9rWR3yk5PEjpUeg0IkJmZr7nFkx ykj5yPFHvgFi6q0VV7ppV4iXEoPTP7s4uZqCeHn8MQ1jVNZio/l7YhwZBYN3pfbK 5nv2jKXsK079UHV9qzmhQH31jZEh//jwcupyMF+k63RpQM8sfENKb25EkUJN5ebQ gNnzdr1ElKsPD8TUQ1B9SVI0QKNpTGMXWsiNjX/BMVblnUvcxKE= =sHaT -----END PGP SIGNATURE----- --nextPart3740035.kQq0lBPeGt--