Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp113899ybl; Thu, 30 Jan 2020 18:09:56 -0800 (PST) X-Google-Smtp-Source: APXvYqywoB61dETND8gEz/8TN0IZcmx7y+ter4EDDn1aGZ0QEJfCtSn9K/4qPeljQEGYHarCJVSC X-Received: by 2002:a9d:6181:: with SMTP id g1mr6151301otk.104.1580436596182; Thu, 30 Jan 2020 18:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580436596; cv=none; d=google.com; s=arc-20160816; b=t64zTwY6pvWnqRejpMU4SdvEZ6ooeZnJzz/6v1Gbq/NW/ivc88Iz4qBoD+Cwwf9EeV 03YuDBECwvgtv1wdmRXlaKfPnixcdMXDrC1t35pN/UYBwa9WvbNOJZwO7sWF8cTJKD3r KYANqMRKyQAytGfxmTMU70kkm3aW50ZAKnFp4OpWJqBIEjOz50bfA18OFnSXgOfeI5ZV G/4uoKnbO9r6N4byh8nsptoVDbg2+1qIgAJP332o2eMCK/yPLQMtUN2BNHM2txpiJBjd Gl2+ZoRTcp86u+R4XLbaDlWyCMHU1RPPnCLA/4ooepkPoEGlc4CMyjnFj71hH8ox/jw2 DN7Q== 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=eAN7TYSx5Ngnmh1dy1RUM0HJOBtCp5tpJodPVFhl6LQ=; b=DheVA/NV1xBskDqJjRKzOkDvsoWs2oIl83xJFqdjZhWusr51bGn+VhePQNSsNboACU wg7DlETtnaqaynjiEmhz2qJaFExfl48FHQyVw6Uf3IasyNbueQOGfiIlX0CPvkOf1bdV qVt//lX+XCmMurlyKK6ejdQ1ltS/KeOWE+OtvCd4vTUg8N6jrP/A5TByyMCFWdKqhiH9 AqanwvRWztKtmbfK4c3LQw+BkfkFVZY16VRSBCW5WJVjpb2Kf/NRQ8TBs1+t/wCeyeCF TFV6vA+qo9Y6nEENEyPyQUyDMQxNhiKDXhwOliYegSYCQT+BYDOs+3WvhK2DidIql9iG sYjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="t/kHqHbI"; 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 w29si4602790oth.313.2020.01.30.18.09.28; Thu, 30 Jan 2020 18:09:56 -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="t/kHqHbI"; 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 S1727772AbgAaCFU (ORCPT + 99 others); Thu, 30 Jan 2020 21:05:20 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:48904 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727722AbgAaCFU (ORCPT ); Thu, 30 Jan 2020 21:05:20 -0500 X-UUID: 24c37e8d9db44fb08dba1a6848d86912-20200131 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=eAN7TYSx5Ngnmh1dy1RUM0HJOBtCp5tpJodPVFhl6LQ=; b=t/kHqHbIsMuJDEtefMCvcLTmsW/5c4BBHLrMccFqL+IkVCD9EQGYsUxoeu3xExjhxaeLQeVc6JHic3PR8Th2tLKjUwCDhHw+oOtddmhwkThlVxzRWfvCm6SWd2aIudQTNypgISxPxIiwjIZsMgp3a3SAABvmQQATXNRZhwr6k0Y=; X-UUID: 24c37e8d9db44fb08dba1a6848d86912-20200131 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1591912662; Fri, 31 Jan 2020 10:05:08 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 31 Jan 2020 10:04:23 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 31 Jan 2020 10:05:16 +0800 Message-ID: <1580436306.11126.16.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: Fri, 31 Jan 2020 10:05:06 +0800 In-Reply-To: References: <20200130064430.17198-1-walter-zh.wu@mediatek.com> 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 T24gVGh1LCAyMDIwLTAxLTMwIGF0IDEzOjAzICswMTAwLCBBbGV4YW5kZXIgUG90YXBlbmtvIHdy b3RlOg0KPiBPbiBUaHUsIEphbiAzMCwgMjAyMCBhdCA3OjQ0IEFNIFdhbHRlciBXdSA8d2FsdGVy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