Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4950307pxb; Tue, 28 Sep 2021 07:33:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVbH0TB0geURmJ3hsfRAIpLqws1Ss0cmRO8+IPWoR5N2ilmubHOl1FkjcdaPi4Jh6svq1m X-Received: by 2002:a17:906:5952:: with SMTP id g18mr7343907ejr.95.1632839594524; Tue, 28 Sep 2021 07:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632839594; cv=none; d=google.com; s=arc-20160816; b=rHpj/VDuBKkkwCWjtySzoaA9nmitGE+wnkLr6UkpxO50TfaeOqWzbYc7mPDHJbfkBf BJKlgQQ1UAzulLxt3WF5LSvdUE2UZJF1cdGsWG2LpzVVdYbMAW53F93EeDfr8Gt7HF9G 0uCg3Urz7tCotpeH38qm1KWWY83ZxrqOc/THDaV3vzYpqAAyxUNHnUIdB30KJUEDtIQp 7Q3dinumcaiHaKexmtrLJb94UdZsuq3Icu30F4uOP8kR0cc1+ga6at8sTnjfVfMHBc1z 0Asn4PWJlTq/zpiemOSrdmnmh/ULbLSPdlxXPKVlHlS7qifPyhovrT1tvU6gmRxjtpRg eJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SlTizmY7Szq/oKJhNf9yib5mfTsaovwgKAlrcFr83EU=; b=aFjsGWTGnb71mFziQJx/a0jKp/49J/AgPx7xuU49U8lCChXXAaSgjnZDGTaop+QtyO WcgZBUpmCXAStpX3MRvDc7uGAqnRjGTgXqLo3Y33Hd/yzFOe2wJPrJSh5k/va1HYHs+F m2u/Pl8yfGgBODYzlIj2Y84k7s7zaVgRfxGUayOTUwtFci0f3zhEY5+b2AFkdPMVQOYW xtuVsDhWI8PParFViqXs2MA7hf2zCHw33Dz6+M7K86jyau4RkS12fw1sPOgjMjEEVZrj qZf2TRsROtq62C/xbYRlMiSKI3myKGL69Vxo1CerAMFLZs5xQpSzuscleNQdNLoymLPQ SUng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rURbXiZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si21103306edr.23.2021.09.28.07.32.48; Tue, 28 Sep 2021 07:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rURbXiZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241311AbhI1OcW (ORCPT + 99 others); Tue, 28 Sep 2021 10:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241280AbhI1OcV (ORCPT ); Tue, 28 Sep 2021 10:32:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592FEC06161C for ; Tue, 28 Sep 2021 07:30:41 -0700 (PDT) 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=SlTizmY7Szq/oKJhNf9yib5mfTsaovwgKAlrcFr83EU=; b=rURbXiZXq4hHr3tBbNcObnNJON 5c4luiZoDNnaPhud7MHRme4A/Tp9NnhxXjDTXwP5DmcwbmrUzkdrOXjPr+cZucVeRWf7OCidyGrDw bQ1Dgp9vdG178XWCrHbOR3HuneEUvfnHNgD89v4cSRM70NRatbaD8QXARsK1QmGfLualMCUWVlHRl UBNDmwXM7uE5XujoFeLMoXs4szUYtR+Bl9//P3ylvPf4gly8Wg+uzFtv/tIapVPEVkA8623J607/Z vdNdXxdQX8DRK45/dZvMrI6YHuC5rAEMavHHkoBE54WhZRh2HlfBBRdda1mY8iO2TRvpfnO7hcEkt XUyBmPqA==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVE6h-00AwBU-On; Tue, 28 Sep 2021 14:29:37 +0000 Date: Tue, 28 Sep 2021 15:29:19 +0100 From: Christoph Hellwig To: Jiasheng Jiang Cc: bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/microcode/amd: Add __list_del_entry_valid() in front of __list_del() in free_cache() Message-ID: References: <1632819884-800736-1-git-send-email-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1632819884-800736-1-git-send-email-jiasheng@iscas.ac.cn> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 09:04:44AM +0000, Jiasheng Jiang wrote: > Directly use __list_del() to remove 'p->plist' might be unsafe, > as we can see from the __list_del_entry_valid() of 'lib/list_debug.c' > that p->plist->prev or p->plist->next may be the LIST_POISON, > or p->list is not a valid double list. > In that case, __list_del() will be corruption. > Therefore, we suggest that __list_del_entry_valid() > should be added in front of the __list_del() in free_cache. No one should be using list_del directly anyway, so please fix that.