Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6414657imm; Mon, 27 Aug 2018 15:42:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZbZ9tGnEg/Ty8uuX6lvGIb7y8bf4wwhjFLWeEWPcgvuQ7W0GFnMk3mkwWEuJK/kvj5PN/N X-Received: by 2002:a63:1d22:: with SMTP id d34-v6mr14133924pgd.133.1535409734633; Mon, 27 Aug 2018 15:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535409734; cv=none; d=google.com; s=arc-20160816; b=awDH+pQtkmAbFkoR9WFhJ6hJ5mHdsmPlJrmCe9Nv88QjDTIirEdB+/EIBJuR1z5PXP A1xwqS0pr6mbFX/G1b2MzolmRpgbFl4QKuGNrhQBZ+E9qvztty+XcuBy6S9P23RF+HOY 0rTm1PQPaOM72uV7v3sBIlZxVJL9OZqFRrKju7s7zEPQLiEv93MJs8OmmkS6hnGv3TQb unlzAPrrrmVIq4Al2wfhCMtvcAXE2QLIbYBQlLf1MVUlxxLNxi8ScSNlkRTGt3xdJU44 fpGVIeCgCb6asC8tth/TRXdt58Hs1Sg5y4IRkbOysFle6D3HpBLrHRiNG8jcjERicB6k Xd5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=CjnucCmvb7OKX3MuuKRBZR8N3m8Rj7Fk91kgiuJ8bbE=; b=hWe3tbEb+bvFXvEIbuEIEHlYXIbxYIQ3bT2ofVEInI7QdCKPVY7d2XLUxqlkVtUGMp +hYAOUDPCqeRJ9Uy+bv1r6Dr7xD3In3gNkoXBA6Q/Kh3bpz4wQmnStTovL4Jm4ooy+pK HDn9BibF0iJbBDXVT+YHcF6/p3Z2Jj0nll1TMt6k9SmJZVfZcH68kDKaGB6nalREViNA s72WVXNEB+bOZj9ILRjPxXWAYuGjQ9vPu1qdAxFwA90+IXXUv4609cn6rMvTfhDkf9NH GFX0w9ZTF3LxAnxy1xvoy9j7Mv06kprUoej+V9YhGevdBfowdSR3vdzPN8FxiOqLz81Z 3U6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si488443pff.192.2018.08.27.15.41.58; Mon, 27 Aug 2018 15:42:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbeH1C3c (ORCPT + 99 others); Mon, 27 Aug 2018 22:29:32 -0400 Received: from nautica.notk.org ([91.121.71.147]:51442 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbeH1C3b (ORCPT ); Mon, 27 Aug 2018 22:29:31 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 808B7C009; Tue, 28 Aug 2018 00:40:52 +0200 (CEST) Date: Tue, 28 Aug 2018 00:40:37 +0200 From: Dominique Martinet To: Dmitry Vyukov Cc: syzbot , David Miller , Eric Van Hensbergen , LKML , Latchesar Ionkov , netdev , syzkaller-bugs , v9fs-developer@lists.sourceforge.net Subject: Re: KASAN: invalid-free in p9stat_free Message-ID: <20180827224037.GA18923@nautica> References: <000000000000af648b057456e234@google.com> <20180827052412.GA26294@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dmitry Vyukov wrote on Mon, Aug 27, 2018: > kfree and then null pointer is pretty common, try to run: > > find -name "*.c" -exec grep -A 1 "kfree(" {} \; | grep -B 1 " = NULL;" Hmm, right, it looks like somewhere between 5 and 10% of the kfree() calls are followed by NULL assignment, that's "common enough" - not generalized but not rare either. > Leaving dangling pointers behind is not the best idea. > And from what I remember a bunch of similar double frees were fixed by > nulling the pointer after the first kfree. In this case it really is an error to call p9stat_free again, so let's just do both. Will send the patches shortly. Thanks, -- Dominique