Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4641420rwd; Tue, 23 May 2023 10:16:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6icXVSM5mKcdUKfGt4hRHfymipVIazWU8ZB01HjDniR3DrCqwphbfev2668+qA6LOlfoJY X-Received: by 2002:a05:6a20:72a8:b0:10c:1047:68ba with SMTP id o40-20020a056a2072a800b0010c104768bamr5690293pzk.35.1684862173327; Tue, 23 May 2023 10:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684862173; cv=none; d=google.com; s=arc-20160816; b=nDfI6lWUBqG7aBq53tI6QK9yL8Omf5JpoAHq4XCggja7cB8a4AEosOv3Splhj9XN/p +TkESanivfN+P7a+Qhd2OvFlznx8qJuxRYcHitw6KdGxVAFPE7V3/B2R0iwNXJmZNaKr SX8Tk4E52zCoKPYtqyaJV4aK4HMUMRk0whedv7CcZ3iXrn4nf9wLOjCv1ZtfD9fJdnr4 oDEZieAlHOUWLjQOvYmgScVh8dHQNQ5WpvbNOckNpp5ONF5C8nWZXo0aKiCcqArWF65+ 80exLBsuNkD3Pb2ttfeBVc92YWTa952QxiXvoI2DiDSY88yLrRFvyZhIzBznmwqg6cpU cujg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lAAodiyGWsaT6Idtby9CZIckSp/ylQBdaFt1VWfkThI=; b=YoDnzgk19OBVX7/xKPYa55TVyCE4/rJCwOzMaD5/hcYU59NaoAxpnU9c5MBIrJSh7r Y6ins1gtMIQs2/jdxNxOePYckUk3KFQ4Zl8nLTofxAoZogZpARdpma4uns4CqZdYvzgD yaS1rexQDz9GtYNM2C98PFjwVR04FqB+trbc+HqdsUnq06H8le+NiWvvx53TU9AEwDnT JPyp+Jphgtq9bLLrS9Ri21MyOv2qBdTp3nnN6BnQe7MulQUhg2USwRB1wBGorOG7U1eQ jBMQaMPSPncHjENgWVKzjNn3SyKOLJ3ZiQejiL2sON0Gl0E1rnYn9N8eH+sAu9xnMHhe BEpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=jAEDfDfm; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630b06000000b00528593926e3si1573888pgl.627.2023.05.23.10.15.58; Tue, 23 May 2023 10:16:13 -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=@zx2c4.com header.s=20210105 header.b=jAEDfDfm; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237923AbjEWRCR (ORCPT + 99 others); Tue, 23 May 2023 13:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230351AbjEWRBj (ORCPT ); Tue, 23 May 2023 13:01:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CAE9C2 for ; Tue, 23 May 2023 10:01:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E6A96634C5 for ; Tue, 23 May 2023 17:01:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BB37C433D2; Tue, 23 May 2023 17:01:36 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="jAEDfDfm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1684861293; 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=lAAodiyGWsaT6Idtby9CZIckSp/ylQBdaFt1VWfkThI=; b=jAEDfDfmf8BHdnZsb8HAiQ2DXBfHNn0zo6txVrJOmcDe8gAWG+0XwNg/Bdh1NQ9pL4HM/9 VBC8cgXnMBgQoduzDaAtNUrQMAt9z6ZDOM3EclU+O5iy9lpm5jclnUtbBdp69bi4yCs3PY CGzKmA6kh/JJlTdI9Nzy40hrMT/0oHw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 276351ad (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 23 May 2023 17:01:33 +0000 (UTC) Date: Tue, 23 May 2023 19:01:31 +0200 From: "Jason A. Donenfeld" To: Jakub Kicinski Cc: Eric Dumazet , syzbot , netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com, davem@davemloft.net, linux-kernel@vger.kernel.org, pabeni@redhat.com, wireguard@lists.zx2c4.com, jann@thejh.net Subject: Re: [syzbot] [wireguard?] KASAN: slab-use-after-free Write in enqueue_timer Message-ID: References: <000000000000c0b11d05fa917fe3@google.com> <20230523090512.19ca60b6@kernel.org> <20230523094108.0c624d47@kernel.org> <20230523094736.3a9f6f8c@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230523094736.3a9f6f8c@kernel.org> X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 On Tue, May 23, 2023 at 09:47:36AM -0700, Jakub Kicinski wrote: > On Tue, 23 May 2023 18:42:53 +0200 Jason A. Donenfeld wrote: > > > It should, no idea why it isn't. Looking thru the code now I don't see > > > any obvious gaps where timer object is on a list but not active :S > > > There's no way to get a vmcore from syzbot, right? :) > > > > > > Also I thought the shutdown leads to a warning when someone tries to > > > schedule the dead timer but in fact add_timer() just exits cleanly. > > > So the shutdown won't help us find the culprit :( > > > > Worth noting that it could also be caused by adding to a dead timer > > anywhere in priv_data of another netdev, not just the sole timer_list > > in net_device. > > Oh, I thought you zero'ed in on the watchdog based on offsets. > Still, object debug should track all timers in the slab and complain > on the free path. No, I mentioned watchdog because it's the only timer_list in struct net_device. Offset analysis is an interesting idea though. Look at this: > The buggy address belongs to the object at ffff88801ecc0000 > which belongs to the cache kmalloc-cg-8k of size 8192 > The buggy address is located 5376 bytes inside of > freed 8192-byte region [ffff88801ecc0000, ffff88801ecc2000) IDA says that for syzkaller's vmlinux, net_device has a size of 0xc80 and wg_device has a size of 0x880. 0xc80+0x880=5376. Coincidence that the address offset is just after what wg uses? Hm. Jason