Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11631168ybi; Thu, 25 Jul 2019 20:41:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqywv2CMZZ/QhVH4jKmf7EKUsy8hlpbYD+qJ0Hb5NdVgpbwD/771+AmOd8tGdoqQahV1owGQ X-Received: by 2002:a17:90a:1785:: with SMTP id q5mr95134895pja.106.1564112499292; Thu, 25 Jul 2019 20:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564112499; cv=none; d=google.com; s=arc-20160816; b=DrkS9VL1CJNiRXHcRGNY4V1kizkwh9qo/Lh3EBCqmpuvXyrhm/uvQItgQNwxWH1/Ai pVh6FuzgUipuKFAAXmfIWRFnbBJyh3j1IVxKqJbjfcACt5Gf8+9Qp8Afwmha/5r+mmiV CkasNLTMiZ4xMu3XALs7OmVxYdTP9S3cRDFL4iDLhlCzPCYwXk/j7Vdq/4PHTxObEifg G0ltNTfvciyWFleId2147LR/4xNWs8ohwWoCNl1udc9h/6S9gnINNrSu9TJM3Pwbcs01 EuzzOpIXN+G+Ts6R5+EZ2XStIV6Pr6of7kaBiNBa4KPABkN6HF8XHeJAjAWM1p0xXtPK WcPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=x9jpkKsawqv16UAcPnvGSGklT2l7v1L3clQy/LaazSE=; b=DsNf/i/mX23MLu9iaacTX5+sl2xBHjR8nWiXkD9qfJ9RUOHe7MkVWuJdc74V0Qotrm 1CK2dc+6Gs+7byCkWJWjSWUzp+WAcF78RLKyDcZrhVHyxjXRJ0LfsBSE74JVq2kUVgdq aA21IY7aTjZ14yS85MqO3VLtMDu00GQfSLgKdpVC0fqhiccDMkZkiYi1byB9EsFsOKaV xvsjzipuQsey9ZkEKroz5GbRBJ6FEAmLuzhHls9wPLDMvs7Xo0lrna5MSISpFfuy4Zeu XkXTLMzX7iQnbMO78KYBkrMaPGfk1obBiBs8X+uHdzJMKCR/CZBNHKQbHuU67SfV05NR MWUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="ti/+4SPY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si18853542pgr.172.2019.07.25.20.41.24; Thu, 25 Jul 2019 20:41:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="ti/+4SPY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725955AbfGZDjF (ORCPT + 99 others); Thu, 25 Jul 2019 23:39:05 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:38271 "EHLO mail-pf1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfGZDjE (ORCPT ); Thu, 25 Jul 2019 23:39:04 -0400 Received: by mail-pf1-f181.google.com with SMTP id y15so23787248pfn.5 for ; Thu, 25 Jul 2019 20:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=x9jpkKsawqv16UAcPnvGSGklT2l7v1L3clQy/LaazSE=; b=ti/+4SPYRcJdC2ON+0rZow0dnLBewWtmxUej4Wq/2hSnhBHk+w8ww0NY40o1Nq6Umw R5R2HRP/xPjYmsSQsz/9Jve182Fb+hs1UwWtKgzlEbZzKOsq4xDSG8kjtoi37ePmMCB2 u1fT4GquAsRIFlT7cwVVBWnUgFnQiZfRshv3o/isLQIrVV9m5prAQWi9kKM59DL0CSrD Ldonv6rqPwcmaWTRK6WQnDg3Xlc5GS1uDVjmB5+t5rPOHZixbd12SKCy6GltDcf6PUGz 1olB+ArkOlSzGYoQFiOsD4JqvTRiq9cdwAA3nFireAhbVgL60n8nY1hpwTT7u98/l5XK 8hkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=x9jpkKsawqv16UAcPnvGSGklT2l7v1L3clQy/LaazSE=; b=D9OGAaAiW7/manbEoUAZsgvammUjI+I9PauL05uwZwf719SyBXbKVuOKB7cQtOGXLM xx2M4xkeFOF3qjeXh/zPP9G6CW9IScLGg+1ajxNT73MYgNVNy3H3Dht+pQ+E1pgWrK73 K9YlB73sPqzyct3v2iNoNHbVxu6M9CUj3KSUzBLFbZSWRd3ayucomT5E+YqnJF5nFH4V GCSTxCH/+sSn5RHgxO1zVqIj6Y1H+/wVoPThh3P7rpmJr0UTCaUAzKwkAlVbROGpzVCT AHnwNFOED56XWadwTe1e9P10BCZeQsurcHXF/ZnNqBMT1Pnu8HtbctzfVwTRJxI8WqkW zjEw== X-Gm-Message-State: APjAAAVHdUByACwBybjBdCbni83Ud1bfylQ42aND0XLoHVbcP4UDtQ6p 1BJMTnIbs7rYPPX1y7PR+uOzkyysSn8= X-Received: by 2002:a17:90a:372a:: with SMTP id u39mr95911266pjb.2.1564112344038; Thu, 25 Jul 2019 20:39:04 -0700 (PDT) Received: from ?IPv6:2402:f000:4:72:808::177e? ([2402:f000:4:72:808::177e]) by smtp.gmail.com with ESMTPSA id d14sm63212225pfo.154.2019.07.25.20.39.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 20:39:03 -0700 (PDT) Subject: Re: [BUG] fs: f2fs: Possible null-pointer dereferences in update_general_status() To: Chao Yu , jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <2d66cd56-eccf-9086-c5db-118acce717a6@huawei.com> From: Jia-Ju Bai Message-ID: <889d8107-a122-cc15-ed08-959b34dcf248@gmail.com> Date: Fri, 26 Jul 2019 11:39:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <2d66cd56-eccf-9086-c5db-118acce717a6@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/26 11:19, Chao Yu wrote: > Hi Jiaju, > > Thanks for the report, I checked the code, and found it doesn't need to check > SM_I(sbi) pointer, this is because in fill_super() and put_super(), we will call > f2fs_destroy_stats() in prior to f2fs_destroy_segment_manager(), so if current > sbi can still be visited in global stat list, SM_I(sbi) should be released yet. > So anyway, let's remove unneeded check in line 70/78. :) Okay, I will send a patch to remove unneeded checks. Best wishes, Jia-Ju Bai