Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3224803ybl; Sun, 2 Feb 2020 18:09:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxuBDvirP6F1rDpuEDnevRfASR1YA+rcv86K91xU/y37+1oCKXccmSWdjTWwSCyyjWPlarZ X-Received: by 2002:aca:5258:: with SMTP id g85mr13703034oib.80.1580695766155; Sun, 02 Feb 2020 18:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580695766; cv=none; d=google.com; s=arc-20160816; b=UfEJA1Wp2gligSL9a8kNZAOsZTILowsINv5mWMWWEqyfWU3KdrvOKYoxLym3M2QxCc XPVnonF9MTObhlntunlyRNZ7TiBM4+JkvasOp2HmapWMd6L9Uu7KPpg7mvmtgXqGTBxb K0Ox2Bh2wqRKKNjOSP0hTAC3vCzs4KDZptP8SA9fFfzJ6VW36AAzRsxkGQ89JOKNtBpt +YdoT7umYJnVZzu6fvp06C9ONTmWH6CT+qIEpe7U4im8mdVVEnBq4qchQvY17Nwt62n0 XHJoQGCtuSPCN72VXnZQt5DKEeFKqxIvTPlXY9E6uo9//QO0Cwg+7vVZ31ZZ5D+wCBdg plUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=NWarxv3wt0FpySWansQ4rSsY2Q9gQTyzvXi1iyPbHi8=; b=0vfed/5sQWF88vMqde97h3c6/9PGrIbE1+WUcbOEybEJDKHJyU025+6RCgzP/f44Uq Kg6nHcO5b654RvhnxiSYRqC7Vnljbv9684AC0TCJo91laPqXcjaeTujwvGGbmLVVhA64 ut/l/JiG5JRVzyU/NXp8g9VUnCOZnoP7FzXFXB/LNVEwM4Ttdp0LkueNf6i934xzPAnA krKJULOX/7yz5jc1v5Pvv6botrrKodOlNACHDIMWaRJGuQkmNzpx+E2RRmybAjYZ3jWR gVKzaay3MFwHMxA9UqgbTjHQlTe2Jei45i4FC5p+XLyYdm1ytaGPeS46CMzGHsUPDhHq qivg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=KfUoiozT; 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=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si8491551otp.139.2020.02.02.18.09.00; Sun, 02 Feb 2020 18:09:26 -0800 (PST) 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=@mediatek.com header.s=dk header.b=KfUoiozT; 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=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727244AbgBCCFv (ORCPT + 99 others); Sun, 2 Feb 2020 21:05:51 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:10826 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727164AbgBCCFv (ORCPT ); Sun, 2 Feb 2020 21:05:51 -0500 X-UUID: 71469db80d4c4a238448bf648b9e4005-20200203 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=NWarxv3wt0FpySWansQ4rSsY2Q9gQTyzvXi1iyPbHi8=; b=KfUoiozTl+xGCm0GvD2XneP2ZVmfO9bJxcTfBM2JruQjmJZ1UvKGiyqhkMYm+fkaIfIB0g/b5Cuza/pnklo4z2bfFbDmN8aPj2PCKlrwrrwwag+qhlrwN6PLt3xe+Qw07XnRaAGHXI6dV1VgoKw8s8Nrz4KWd0ipsaMxytotsBo=; X-UUID: 71469db80d4c4a238448bf648b9e4005-20200203 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1162479976; Mon, 03 Feb 2020 10:05:46 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 3 Feb 2020 10:05:06 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 3 Feb 2020 10:05:30 +0800 Message-ID: <1580695544.17006.7.camel@mtksdccf07> Subject: Re: [PATCH v3] lib/stackdepot: Fix global out-of-bounds in stackdepot From: Walter Wu To: Alexander Potapenko CC: Dmitry Vyukov , Matthias Brugger , Thomas Gleixner , "Josh Poimboeuf" , Greg Kroah-Hartman , Kate Stewart , LKML , , , wsd_upstream Date: Mon, 3 Feb 2020 10:05:44 +0800 In-Reply-To: References: <20200130064430.17198-1-walter-zh.wu@mediatek.com> <1580436306.11126.16.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gRnJpLCAyMDIwLTAxLTMxIGF0IDE5OjExICswMTAwLCBBbGV4YW5kZXIgUG90YXBlbmtvIHdy b3RlOg0KPiBPbiBGcmksIEphbiAzMSwgMjAyMCBhdCAzOjA1IEFNIFdhbHRlciBXdSA8d2Fsd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