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 C94CFC433EF for ; Tue, 12 Jul 2022 12:41:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FFE5940068; Tue, 12 Jul 2022 08:41:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AFD6940063; Tue, 12 Jul 2022 08:41:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49E96940068; Tue, 12 Jul 2022 08:41:03 -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 3BB05940063 for ; Tue, 12 Jul 2022 08:41:03 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 11C29205B0 for ; Tue, 12 Jul 2022 12:41:03 +0000 (UTC) X-FDA: 79678407606.11.262D6A7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id D3442140060 for ; Tue, 12 Jul 2022 12:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UWhG7Ip5SnXCg0duAf4R5ZOj7EMneuDd+1yKd/aFWAs=; b=fv4XW2pRMy0PdgxwGCr0TsIHbn XWir5GR5Hs4ppNE6ep6q+EZFeqCWHyXssIvbgQiEh2h+kmg4Ma2NjHE7dnRcwvBv/sS+sklZiKanb KvZ0qcF5V60kmOhbT1OPGHJcbcdrr7Nj7uVA7idTDyKRnKJ3ud1e7sqxHrHAsHO5ODNba2Po+6L6/ vRwzPY3mGdtuY0PK5am+2dyPR9m7wOW+JSYTGt+Cj1fYI++WQvNt4qyWLmfdCKDXUHzLWWxVzXHow 8tpCuUKmmDI20UkM9Xd9IKPzm+cUVVa8c43hP1/73sxQVF93aOP3s8g/FW9+y2CrePR5L2BueW5Hh FHD4YBuw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBFC7-006uQ1-BW; Tue, 12 Jul 2022 12:40:51 +0000 Date: Tue, 12 Jul 2022 13:40:51 +0100 From: Matthew Wilcox To: Dmitry Vyukov Cc: Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Zach O'Keefe , Yang Shi , Liam Howlett Subject: Re: [syzbot] memory leak in xas_create Message-ID: References: <000000000000eb2d6c05e35a0d73@google.com> <20220711133808.d86400ce9960febcb0fd537b@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fv4XW2pR; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657629662; 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=UWhG7Ip5SnXCg0duAf4R5ZOj7EMneuDd+1yKd/aFWAs=; b=BmdRPQw6X+IRv0W87AeR8+bm/kYzq8hiavKWSQYQJPsRdStj3ubHQquV9ruo/bcZVvJioZ 5zfCIp1rkfpWyARyhwT7Q2PD4B2Nsl3SZZRPwYwtlTNJpjFalP7mOOrGM2cCAo/b0K75YA 5uhXP/+pi1ZPiqdgVVvk+WyBXoU2S48= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657629662; a=rsa-sha256; cv=none; b=fDXt9sEb+9Pqg43s5qI/zdlhlX3aXEWoO8Kki4ouX6NQScbD2lGZMK5Qa0d/oLGTmvOtCI ct0OCWelwqBMoISMWVk4aP1o5FYpnq84rmoDP1HzZRcF32DdlPejov1stff5yOytDrotSP /+JS06IeJYWIGVYT7gRbZD4B4sxGHZo= X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fv4XW2pR; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: 9ghk7jxjq5oiiz41w559hw3naw8ktio5 X-Rspamd-Queue-Id: D3442140060 X-Rspamd-Server: rspam04 X-HE-Tag: 1657629661-157117 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 Tue, Jul 12, 2022 at 08:54:28AM +0200, Dmitry Vyukov wrote: > 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 There's nothing to free; if a node is allocated, then it's stored in the tree where it can later be found and reused.