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 D6101C433EF for ; Thu, 24 Mar 2022 16:13:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1572E6B0073; Thu, 24 Mar 2022 12:13:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 104EF6B0074; Thu, 24 Mar 2022 12:13:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0F2A6B0075; Thu, 24 Mar 2022 12:13:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id E3F426B0073 for ; Thu, 24 Mar 2022 12:13:05 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B6D9121572 for ; Thu, 24 Mar 2022 16:13:05 +0000 (UTC) X-FDA: 79279773930.15.D3A4862 Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) by imf22.hostedemail.com (Postfix) with ESMTP id 871C7C001F for ; Thu, 24 Mar 2022 16:13:04 +0000 (UTC) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-2e5e31c34bfso56036477b3.10 for ; Thu, 24 Mar 2022 09:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qD/GtOjGwOlJ7PVUx2PNL/pqrH5OmjHCrCL+mrKUoNs=; b=FWeKjzvOPcv4J6hpCELOZQ5cq/PWnEZySFDbQXiYNSRunZGregPPfCHQ3V1dHGkxLT V1sgoVBVGvr1Y3jtADkZqsHwslTHW6P9ibdTzkg++st+te2PQIG4RmqNPQVBGfnbr1dx h/BPUogr6i28aCYj6pXiYg/our8couw4KZUUdCppB6J/pOQ+9nJcxkZMuyZbrq4gS8Ac VRR7IpdEHtu1QqPoVPpeOC+GF25EEQJ4YcOJO9NPrTsLQyD/JwU4pV7DKMMJ1i753b8F crWlyiN2xaUhUjv9ZVM2fw1t7fvJMRHg/2WEGsb5saCviTbFM8cN1EYbtzQeUBS7/3fj 7KEw== 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=qD/GtOjGwOlJ7PVUx2PNL/pqrH5OmjHCrCL+mrKUoNs=; b=fgb1vcDy5i+AFTT1JLiTUMmtY+kM85gJJqyThACfUwiS2EYZar9WKAMDrLiJ7xpV3+ wQzsi53zpRiwjJBMBW3WWCCY6Jvx9fN/Ae3oQF31NZ7Uo2tByw/8f9jD2zzLaiAEcfV0 JcVqBUkmzkeoY0zJtb0uGcf0gkXXu1IbxfCQuFgntrN6OhB9gJliPvaHGoS5AhxmqLXz nBAYf6n4WtZ1SjVRd5xMy+4oor0akMfeQrPm/czLfhRaI7qAlfRU3KXq1E0IZAzggFl/ gSbxhXWtUa8N+MO5mxRjdiRanhLX6ltmEW5fszOsiOj6Tun8lToLH21lL1H98yD6MAwI pvyw== X-Gm-Message-State: AOAM532Wujh0J1/suBYQdyLE8vq1866ox3iPUjpayJliWqzscAQ5Kiby Uc7xq9tQaeww0kcyduOtSnGBzrM8Qbb5ATqlvJsRRQ== X-Google-Smtp-Source: ABdhPJyLbR0gOHQMYE2j2r5PaK0FjY4hKvE1cHqATs46KJsxpl/UXEMpJO1PdJottFtcCUT77kkjD+ZoUMXv57jRxt8= X-Received: by 2002:a05:690c:827:b0:2e5:a53b:cffc with SMTP id by7-20020a05690c082700b002e5a53bcffcmr5703549ywb.31.1648138383515; Thu, 24 Mar 2022 09:13:03 -0700 (PDT) MIME-Version: 1.0 References: <000000000000cabcb505dae9e577@google.com> In-Reply-To: From: Muchun Song Date: Fri, 25 Mar 2022 00:12:26 +0800 Message-ID: Subject: Re: [syzbot] general protection fault in list_lru_add To: Dmitry Vyukov Cc: Linus Torvalds , syzbot , Andrew Morton , Linux Kernel Mailing List , Linux-MM , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: e1y6wjw13ipu4p1ozespuggetqo78rqk Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FWeKjzvO; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.128.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 871C7C001F X-HE-Tag: 1648138384-222869 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 Thu, Mar 24, 2022 at 4:50 PM Dmitry Vyukov wrote: > > On Thu, 24 Mar 2022 at 09:44, Muchun Song wrote: > > > > On Thu, Mar 24, 2022 at 11:05 AM Linus Torvalds > > wrote: > > > > > > On Wed, Mar 23, 2022 at 7:19 PM Muchun Song wrote: > > > > > > > > After this commit, the rules of dentry allocations changed. > > > > The dentry should be allocated by kmem_cache_alloc_lru() > > > > > > Yeah, I looked at that, but I can't find any way there could be other > > > allocations - not only are there strict rules how to initialize > > > everything, but the dentries are free'd using > > > > > > kmem_cache_free(dentry_cache, dentry); > > > > > > and as a result if they were allocated any other way I would expect > > > things would go south very quickly. > > > > > > The only other thing I could come up with is some breakage in the > > > superblock lifetime so that &dentry->d_sb->s_dentry_lru would have > > > problems, but again, this is *such* core code and not some unusual > > > path, that I would be very very surprised if it wouldn't have > > > triggered other issues long long ago. > > > > > > That's why I'd be more inclined to worry about the list_lru code being > > > somehow broken. > > > > > > > I also have the same concern. I have been trying for a few hours to > > reproduce this issue, but it didn't oops on my test machine. And I'll > > continue reproducing this. > > syzbot triggered it 222 times in a day, so it's most likely real: > https://syzkaller.appspot.com/bug?extid=f8c45ccc7d5d45fc5965 > > There are 2 reproducers, but they look completely different. May be a race. > You may also try to use syzbot's patch testing feature to get some > additional debug info. Do you know how to tell the syzbot to test the following patch? I found some infos from github, it says "#syz test:", is it like the following? Thanks. #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git master diff --git a/mm/list_lru.c b/mm/list_lru.c index c669d87001a6..ddb2ee627d32 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -67,6 +67,7 @@ list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l = &nlru->lru; struct mem_cgroup *memcg = NULL; + int kmemcg_id; if (!list_lru_memcg_aware(lru)) goto out; @@ -75,7 +76,13 @@ list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, if (!memcg) goto out; - l = list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg)); + kmemcg_id = memcg_kmem_id(memcg); + l = list_lru_from_memcg_idx(lru, nid, kmemcg_id); + if (!l) { + pr_info("BUG: the memcg(%px)->objcg(%px), kmemcg_id: %d\n", + memcg, memcg->objcg, kmemcg_id); + BUG(); + } out: if (memcg_ptr) *memcg_ptr = memcg;