Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp996720pxv; Thu, 22 Jul 2021 18:38:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwclOJ1vFkojhjXCH69PLTVtIX/kEk35WmZ5YyPjliWmgjX/HwofAHgHmw/12dHAjZvpAEg X-Received: by 2002:a05:6e02:1d0f:: with SMTP id i15mr1722752ila.199.1627004303491; Thu, 22 Jul 2021 18:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627004303; cv=none; d=google.com; s=arc-20160816; b=RB83e/LvWiQVT+VpIrPmyyklo3Tjl3DHmqr+QSvX8dntxBG9RDwQH9RfJytGRmK1+A IcqwHLlGIeSMlqBwW4LP3Hy1bkNqp90eRIPJdKcbtfJxCR4wuL1P/yN059z7FVs45No/ CvSEXgbCgpKSbI5ayxvrw0B4H/3OjEPXsEzpapfIss49kLsPS+SFiRhmwJTE6ifI+tuR khYkD3q52YjmIPCdc7x39MjLZ0jXWh20MgSYs0DDlFRmGHZHj/90wXagnWGtbdrXy2Gc lGXyRAC715H6ldaBSFUBVlL54vVyFnIBJ7wZkLfJKdTxHVnILn1XjQzCH1z2ZjIXMwt6 iV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=MvD9q2PoUzmwA9nEfG2NmXjqr9CLHlKazZMXuY8fYO4=; b=wPKi3DEWqMIcGHoaAgwEhnFtwMCXUAXCKYcjinrvJujFmWZubZ4J12aDrDt9XdcqKm a9NNw1gcxbWnkeCNpkSipwbSm+gjGAzGL1kcF5e45CUv+XwygkADqrjLygsODc+Oc9K3 0LO49pCrt+Dd7ickn2siV5xn7w6b5D/O9IyNPSV5JFOQE1YvZStQvFoQzua3PXIIqu2R DV5RzcEYrc8VOrvqsU9u0fZ9cHkjfzgDwBNjPUnYgFmaNnmBrIo7Xulh6haRDgg9XYsd 5ZkcOsSLhv8lvszuRsUIsOX6INcvFQIvjL1cNy0XrEFi9nzZaO+PVwDyBG5HdhoMCSjP wwow== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si15947327iod.1.2021.07.22.18.38.12; Thu, 22 Jul 2021 18:38:23 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233050AbhGWA4P (ORCPT + 99 others); Thu, 22 Jul 2021 20:56:15 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:15049 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232892AbhGWA4P (ORCPT ); Thu, 22 Jul 2021 20:56:15 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GWBfX0L1GzZqYQ; Fri, 23 Jul 2021 09:33:24 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Jul 2021 09:36:48 +0800 Received: from [10.174.177.250] (10.174.177.250) by dggpemm000001.china.huawei.com (7.185.36.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 23 Jul 2021 09:36:47 +0800 Subject: Re: [PATCH -next v2] riscv: add VMAP_STACK overflow detection To: Jisheng Zhang , Andreas Schwab References: <87bl6yrcmd.fsf@igel.home> <20210722213724.1f12a0e7@xhacker> <87zguexslf.fsf@igel.home> <20210723075432.098634a2@xhacker> CC: Atish Patra , Palmer Dabbelt , Paul Walmsley , Albert Ou , linux-riscv , "linux-kernel@vger.kernel.org List" From: tongtiangen Message-ID: <52e3626a-2b40-bda6-de0e-68ea12a86dd9@huawei.com> Date: Fri, 23 Jul 2021 09:36:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20210723075432.098634a2@xhacker> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.250] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm000001.china.huawei.com (7.185.36.245) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/23 7:54, Jisheng Zhang wrote: > On Thu, 22 Jul 2021 17:42:52 +0200 > Andreas Schwab wrote: > >> On Jul 22 2021, Jisheng Zhang wrote: >> >>> I think we need to pin the stack before calling get_wchan(), could you please >>> try below patch? >> >> Thanks, this fixes the crash for me. >> >> Andreas. >> > > Thanks for testing. I will send out formal patch later > > Thanks > > . > Hi all: I tried to reproduced this crash in openSUSE code repo( https://github.com/opensuse/kernel ), but not reproduced successfully. From the patch of problem repair, the crash is due to task->stack is released before calling get_wchan, the task state of maybe TASK_DEAD. VMAP_STACK is used to detect kernel stack overflow, there is no connection between the two, it makes me a little confused.