Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp724146ybl; Thu, 12 Dec 2019 04:00:36 -0800 (PST) X-Google-Smtp-Source: APXvYqza1MoKwibjNNS9irF8dVExGsh7G30wcBnz9Dc2VphXoz2EGvUGdXxPfrsF+Aty/PGtM36N X-Received: by 2002:a9d:1d07:: with SMTP id m7mr7856190otm.261.1576152035003; Thu, 12 Dec 2019 04:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576152034; cv=none; d=google.com; s=arc-20160816; b=iTfVwFySPsPP/14kSlcnu6XzV0SsfgCyHvyo57Z5BxQwKYzpUqNYBZMF4tCa2C76Rv 7XpFl1tGkH0YAGbpAo51IiA3fyhTFXUIWaV5wqjiSZhOICUqrD+Qn83VGW93N/F7uSSb GGMd9wM2KalFe8kcKOi/Evs92TWijQgQFuA54SdynDx3fs3WV9T+KAAODy9r7iw6Pm0P d3bX0QpXeLnukl1oQU93dgMzFQPAyuv276/E/W159wgzJAorEniC+HkpyWLsBILR52DS HGVJopfjmB1sxZzc9gBPaehDmCz36/zatp1TJgn0hyNScmiPHdckGSU4QceykEzXdFXn tsjw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dail/LG0z8iZJ8tcfeMMz3hG5C4dKVGEMXa8efdIfeQ=; b=fN9qbdJsfgP3mTnCSVi6yulYMBEnkpAWcALgE2b+98ZlhkdLl22u6w6HJyPhfPx0Z+ tVRxFeOaXC0nF/4UnLyNygChu6256EsdCff2kRom+xGLsiG3OW7yhw4Sqilyx1oSU/M9 pDPpsdBg2rZCWWgGi4F2BWGjBrV3IJ/eLEFxC4th8VM6LxUqMSQbmJBoCxzHr2yEsMEn zvHFRcI2WlssVG28WFReisafWbJLe1f5BHWegWgEFJh8gxJLmVI1NITdhwlGzDjpe05e /GCL52TNFf99btLMPH20KZtiWb2znbmMszIWw8LvuJ8i+7yL0zQpszToYJUQc1A0aXBn LuSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=emk0ikDn; 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 z23si2899033otm.284.2019.12.12.04.00.20; Thu, 12 Dec 2019 04:00:34 -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=emk0ikDn; 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 S1729092AbfLLL65 (ORCPT + 99 others); Thu, 12 Dec 2019 06:58:57 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:1194 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728919AbfLLL64 (ORCPT ); Thu, 12 Dec 2019 06:58:56 -0500 X-UUID: c530bd8ff1574b4487cfd98afd752a07-20191212 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=dail/LG0z8iZJ8tcfeMMz3hG5C4dKVGEMXa8efdIfeQ=; b=emk0ikDnYR7OqJjnq1YxTC2ab8l1nyERP0vDM0f+6r1P2Qm//c7I37Oa653wunvnnKYSV3nZYveEnEyKzVf/88ivN75i9WNtdjbHzbpRM/4kH2Q3hxZxRU093UfuWm89KY4Y6L56MXdcNNx0COrQOuRlvhIQIHsNiYfOYhWoT1I=; X-UUID: c530bd8ff1574b4487cfd98afd752a07-20191212 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1570599864; Thu, 12 Dec 2019 19:58:52 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 12 Dec 2019 19:58:51 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 12 Dec 2019 19:58:45 +0800 From: Walter Wu To: Matthias Brugger , Thomas Gleixner , Alexander Potapenko , Josh Poimboeuf CC: , , , wsd_upstream , Walter Wu Subject: [PATCH v2] lib/stackdepot: Fix global out-of-bounds in stackdepot Date: Thu, 12 Dec 2019 19:58:48 +0800 Message-ID: <20191212115848.21687-1-walter-zh.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain 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 SWYgdGhlIGRlcG90X2luZGV4ID0gU1RBQ0tfQUxMT0NfTUFYX1NMQUJTIC0gMiBhbmQgbmV4dF9z bGFiX2luaXRlZCA9IDAsDQp0aGVuIGl0IHdpbGwgY2F1c2UgYXJyYXkgb3V0LW9mLWJvdW5kcyBh Y2Nlc3MsIHNvIHRoYXQgd2Ugc2hvdWxkIG1vZGlmeQ0KdGhlIGRldGVjdGlvbiB0byBhdm9pZCB0 aGlzIGFycmF5IG91dC1vZi1ib3VuZHMgYnVnLg0KDQp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