From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62AEDC43334 for ; Tue, 12 Jul 2022 06:54:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA5F894004F; Tue, 12 Jul 2022 02:54:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E55A2940033; Tue, 12 Jul 2022 02:54:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D444494004F; Tue, 12 Jul 2022 02:54:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C67E9940033 for ; Tue, 12 Jul 2022 02:54:42 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 7CC9480D04 for ; Tue, 12 Jul 2022 06:54:42 +0000 (UTC) X-FDA: 79677534804.28.3E6B431 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by imf16.hostedemail.com (Postfix) with ESMTP id 1DCFD18005A for ; Tue, 12 Jul 2022 06:54:41 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id bx13so8814339ljb.1 for ; Mon, 11 Jul 2022 23:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rn3i9yImta8oxCfkEnFJ7Ot67eZ6TujXXgzt8R7sT4Y=; b=ihrcO8cVPHAyPrALJVwtzrj2gUBS2E6i3309qBnD3hax2Iy/zRjNk6czP/DsgUC49o e3jCP7oUhlSvTSUrbJjwE6BaT8hqG6cKXG+p9YmuAqIulSEqvl36GbeWPRINrXtLb502 x0TPy8OQv+4rxx54AK2+SN4b+jlcj+qSfXQf6lq1PluyCeAUcnAgYweGYPYj8sYhc5oj jBt1QtXPHpuqmW9yZQelgMATbcV5lHWrQStHw3t3vjvLpn/EZn255PmXW1P2A+XcP2jZ KeXO9KTekIq9fH3BBJiEdb2KNd2cjIhE0Xvod+zYkFIVQtMWGwxErE+8awCF6xZzy0Ca h/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rn3i9yImta8oxCfkEnFJ7Ot67eZ6TujXXgzt8R7sT4Y=; b=GeSlIs64+/oWFNqkyCvxK9Uhz5a8Ze+VuowCT9ZfhjpEjsPJtwh44p/WLTJcchlxHj BDhNrurdlch5yjmTupT2D1TZr7SxbQkPm58QyLFDSm/UPfdvxhuEjWkGEG/4j+StkRAP 86dHjyTuu+6onWnU5NeV/0xSYGzJsaBzIl9F8RsX0osDCFd854kn/BHMn1pMmCcmR6vy JhNOpbx1aAVJ2UnvSAUJBAocIrZBgm8q6+jpE6Cq7iWQGAbnmHMDuM/1QBOX8ucZOFy9 nSxwmrJCcVTsx5JTBiZx5SSNx5jyTsxCelwF5Swi1N1wzvO/Yp7eD43em149uucCVIG9 M4Jg== X-Gm-Message-State: AJIora81lSuLR7aroW5bNeqmXuLWtPz7NwKuDGtuX5vxYWVIBgs2V9b1 RlCWyIbGJ78l9AnrOl5dn7TM+xVGSffnEYJLfBfinQ== X-Google-Smtp-Source: AGRyM1uG/ok2m2oUO2WYxnvG3wzXsku8i0A3iXbzzRKcl8h9DzshoJc/DWAfa9TBBucfiIGwwuvECMdkk5ceWWjWGjA= X-Received: by 2002:a2e:be8d:0:b0:25d:6035:ebd0 with SMTP id a13-20020a2ebe8d000000b0025d6035ebd0mr8580717ljr.92.1657608880218; Mon, 11 Jul 2022 23:54:40 -0700 (PDT) MIME-Version: 1.0 References: <000000000000eb2d6c05e35a0d73@google.com> <20220711133808.d86400ce9960febcb0fd537b@linux-foundation.org> In-Reply-To: From: Dmitry Vyukov Date: Tue, 12 Jul 2022 08:54:28 +0200 Message-ID: Subject: Re: [syzbot] memory leak in xas_create To: Matthew Wilcox Cc: Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, "Zach O'Keefe" , Yang Shi , Liam Howlett Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657608882; a=rsa-sha256; cv=none; b=VPu55bS9QlZxjfsCG96U62HsMb0LyxW1L5CIAuZiAkHKJnpl8gcCDbRZmsKMfDTCj94Sx7 /Fx5AwnmBkPnr9OEjMZrI67rL85J6SaMX0Jf63wLs+FhUd22jh/tP3OxEHxsKt5fgZxrQh GDUrw1iutzvnJXbfOV02dKo/+AhbB7Q= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ihrcO8cV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of dvyukov@google.com designates 209.85.208.179 as permitted sender) smtp.mailfrom=dvyukov@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657608882; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rn3i9yImta8oxCfkEnFJ7Ot67eZ6TujXXgzt8R7sT4Y=; b=RCmE8wFjY01J65MexRal49VrPTIBPHKd1g91BRkNdLUhesNx5chKuPO0g6tg038lPR9XQN A8ibXHuQeBY5wJgEHerHTRjrw1i+7ML6HZ3l/7o+vEoxR4KfufdGsOfmURQcps5pXbrge/ qPKJAXGl0UDsgh4SThuRHkYiWnRKsyA= X-Stat-Signature: mu181hxoe6nj9pyog9zgqykrh7qp4wcj Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ihrcO8cV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of dvyukov@google.com designates 209.85.208.179 as permitted sender) smtp.mailfrom=dvyukov@google.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1DCFD18005A X-Rspam-User: X-HE-Tag: 1657608881-200585 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 11 Jul 2022 at 22:47, Matthew Wilcox wrote: > > On Mon, Jul 11, 2022 at 01:38:08PM -0700, Andrew Morton wrote: > > On Sat, 09 Jul 2022 00:13:23 -0700 syzbot wrote: > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit: c1084b6c5620 Merge tag 'soc-fixes-5.19-2' of git://git.ker.. > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=14967ccc080000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=916233b7694a38ff > > > dashboard link: https://syzkaller.appspot.com/bug?extid=a785d07959bc94837d51 > > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=122ae834080000 > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > Reported-by: syzbot+a785d07959bc94837d51@syzkaller.appspotmail.com > > > > > > 2022/07/05 05:22:17 executed programs: 828 > > > 2022/07/05 05:22:23 executed programs: 846 > > > 2022/07/05 05:22:30 executed programs: 866 > > > 2022/07/05 05:22:37 executed programs: 875 > > > BUG: memory leak > > > > Thanks. Presumably due to khugepaged changes. > > Huh, I was expecting it to be something I'd messed up. I've been > looking at it today, but no luck figuring it out so far. > > > Can we expect a bisection search? > > We only have a syz reproducer so far, and if I understand correctly, > it's probably because this is a flaky test (because it's trying to > find something that's a race condition). > > I expect a bisection search to go badly wrong if this is true. Is it possible that parts of xas are not freed on the error paths? I don't immediately see where anything is freed on these error paths: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/xarray.c?id=c1084b6c5620a743f86947caca66d90f24060f56#n681 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/xarray.c?id=c1084b6c5620a743f86947caca66d90f24060f56#n721 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/khugepaged.c?id=c1084b6c5620a743f86947caca66d90f24060f56#n1675