Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp925165pxp; Wed, 16 Mar 2022 21:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaVYsWI0pEG1uMb61sJyvoCnOaqseCqu7Dj0PhP/V5BJkWdWABQk55Ev6ZOXQVus3jF2Nj X-Received: by 2002:a17:903:2448:b0:151:8173:abf5 with SMTP id l8-20020a170903244800b001518173abf5mr3171428pls.55.1647491478662; Wed, 16 Mar 2022 21:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647491478; cv=none; d=google.com; s=arc-20160816; b=LFoscvOor1Xjyt8dhWr27D11AADEsm49/6jM/qxwUtnCXdPx/DDV2Ml/6s3Y8ugrRB 5JWUqPSIqyaq4Wy2nKtAcY+HRVKrAvGVe5VvvdhRwMR0ci4rQKxvS/lXlooiFlzJKNbH RaokaDAZXGk6k72hxWuo7Br7VIAyoQXhDzh9il3hd0rrApPYVLGbCUNhzigHxEb+xRa8 VnJ0Zx/iMHpBGpTjieLVqAooMMe0VDD/85ai8IevuUm2cOWJVphjnLwfkrkP6EFnisfx p/RqzAxofisCDheSOn9HMyt9FOskcJWCyDBX5cwe9DnwdHFhKoaA4u6B1v/YehFHDbT1 0ebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PtN/jbkQYVBp1obBwl/awmjNIsL5JS0RMZsDYUjJRLU=; b=pQOOSSAlRHATvpeuMbWNBA/5IA2zZrEkJrGwVLK/L6J2GwAKMUCZi/iJVEgcxwdSju krqY8Pkwm3FOgwVdx1YDdIFakUkLrgH8qXHFky/XiOFMC75nezaRNmuGFLt3yEzqgPpc p/x7u5QKgyb80KBnOoAF7Otp0P4IQ3T0vd9QjgFmMv3sqX/BorpEI2yvwLdE+NXuDLXk 02c/YVSKEoWts6cFh8V3hZhSRCC5p3Sfl+qaQGYKVrP5i/ORoP3bDQJwmB+TDqT+bwgs RMeKWoo6Ah8C7/akUfktJYw0fngid+IArzbtygBYkfRfowAGlyaXt71LcRAt9TRG4xPz YOhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=inIIZasC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p14-20020a170902a40e00b00151dcb746a4si3318120plq.21.2022.03.16.21.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=inIIZasC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 02D37483AC; Wed, 16 Mar 2022 21:00:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344355AbiCOCAX (ORCPT + 99 others); Mon, 14 Mar 2022 22:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234046AbiCOCAV (ORCPT ); Mon, 14 Mar 2022 22:00:21 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB69712753; Mon, 14 Mar 2022 18:59:09 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id qt6so38015502ejb.11; Mon, 14 Mar 2022 18:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PtN/jbkQYVBp1obBwl/awmjNIsL5JS0RMZsDYUjJRLU=; b=inIIZasC0nzTHagFiVWYnEJPjMezzne2C7jx84dqB13QiQTNNk4QRacDeNyz1LUJWM nhCoyEllJsHr5Cp/5SOpQGVzNNv4+yH5U+ZhANMPeyXgqUIWhqGgoIKakece3iT8wDwn xjVg73emSuPj6qcxX+LFMPsGpHSFQprIm6hT3Piexdx0tMgmegT3B6EIc/sG2U7GqpZV cs2wXLqUGT2WLcCZNjXEu+XmymA1dNNQ1wyXNXi3rPnETvjbwUl9K1tirGLqyxsygwKC ylKcaZrt/2kHRyCDStHtAkuFhbgyp5k4Ne7imYmorvgSJK4x7GAHJ6GuLuJVfaaibdzO X+vw== 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=PtN/jbkQYVBp1obBwl/awmjNIsL5JS0RMZsDYUjJRLU=; b=bk2CnwOjlLtbSxrEDtRmMYqtnLAxv+MtzvRxvM2TS1wiYvsPX2P5Qj+inCzJFlqkUN Ur3wR38CCiTWzjVjaS5Ix8db25OGRIsy8fTahz9xLOZ1VnDrZ6tryndlLTgutXddhB81 94Dsnk385uhq1OvtHrMJW2z8z5VtZFOht6j2E7eI2OFEIV05vfQKPhFExp4L21CcFRAA Jgw1XLKmXbH/Ekf+N0OvjKPT/b48mril2edmL7f5DQd/YYy+3h7efYDQriEthKkcogfb +wQzJStoUnn3KQ7BpwlS7vwalAHzd6uyasKNqz22DtNX7MvsiSV4FgBkCj0grtX0b0gu pVlQ== X-Gm-Message-State: AOAM533aQlnNYCVClwyWDi3W3OzrEICCLEjJzleo4uuEdFxLy4x6DT29 LylJxZv005HNAsM3k5GGDmkAWmSy5fo1mtw+iMA= X-Received: by 2002:a17:907:9482:b0:6da:a24e:e767 with SMTP id dm2-20020a170907948200b006daa24ee767mr20271779ejc.479.1647309548400; Mon, 14 Mar 2022 18:59:08 -0700 (PDT) MIME-Version: 1.0 References: <3192BC90-D082-472B-B310-6E09A14A77C6@hust.edu.cn> <7da316f4-aa65-896e-9020-2dfff2bbfc09@gmail.com> In-Reply-To: From: Dongliang Mu Date: Tue, 15 Mar 2022 09:58:42 +0800 Message-ID: Subject: Re: Fw:Re: [PATCH] fs: nilfs2: fix memory leak in nilfs sysfs create device group To: Ryusuke Konishi Cc: Pavel Skripkin , Andrew Morton , linux-nilfs , LKML , Nanyong Sun , =?UTF-8?B?5oWV5Yas5Lqu?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Sun, Mar 13, 2022 at 9:35 PM Dongliang Mu wrote: > > On Sun, Mar 13, 2022 at 12:01 AM Ryusuke Konishi > wrote: > > > > Hi Pavel and Dongliang, > > > > On Sun, Mar 13, 2022 at 12:16 AM Pavel Skripkin wrote: > > > > > > Hi Ryusuke, > > > > > > On 3/12/22 18:11, Ryusuke Konishi wrote: > > > >> In case of nilfs_attach_log_writer() error code jumps to > > > >> failed_checkpoint label and calls destroy_nilfs() which should call > > > >> nilfs_sysfs_delete_device_group(). > > > > > > > > nilfs_sysfs_delete_device_group() is called in destroy_nilfs() > > > > if nilfs->ns_flags has THE_NILFS_INIT flag -- nilfs_init() inline > > > > function tests this flag. > > > > > > > > The flag is set after init_nilfs() succeeded at the beginning of > > > > nilfs_fill_super() because the set_nilfs_init() inline in init_nilfs() sets it. > > > > > > > > So, nilfs_sysfs_delete_group() seems to be called in case of > > > > the above failure. Am I missing something? > > > > > > > > > > Yeah, that's what I mean :) I can't see how reported issue is possible > > > with current code. > > > > > > > > > Sorry for not being clear > > > > Understood, thanks for the reply. > > > > If so, the case where nilfs_sysfs_create_device_group() itself failed, > > is suspicious as mentioned in the previous mail. A possible scenario > > I guess is : > > > > - nilfs_sysfs_create_device_group() on the first mount try fails and leaks > > due to lack of kobject_del() in the error path. > > - Then, nilfs_sysfs_create_device_group() on the next mount try hits > > the leak detector at kobject_init_and_add(). > > > > So, if the leak bug is reproducible, I'd like to ask Dongliang to > > test the effect of the first patch. > > If my local syzkaller instance gets a reproducer, I will try to do this. > > > > > Regards, > > Ryusuke Konishi Hi Ryusuke, The crash still occurred in my newly set up syzkaller instance. It appears after two days' fuzzing. I remember you suggested me to add kobject_del just for testing, right? And let's see if this crash still occurs any more. > > > > > > > > > > > > > > With regards, > > > Pavel Skripkin