Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1418494ybl; Wed, 29 Jan 2020 22:45:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzaMoO/AU0Du24q8XDBzg+BovSbpev639gUYXkZofZ5yOd1PfGnusUBg12G8JJpQXKo7X4A X-Received: by 2002:a9d:60c4:: with SMTP id b4mr2524710otk.166.1580366748216; Wed, 29 Jan 2020 22:45:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580366748; cv=none; d=google.com; s=arc-20160816; b=FHhpw5wUBW33aVlnflu3RGm0fMqoKHgYBYqRK+kGBTtXy6gHGfXlRmQyJu5JXu+awX 3QiF4levuiQAWW5yal/ktM06fiSSrVdTGPrI1pKyvpml6MA9d+SYDfOAfLBQ8Jm1PH6Q BIqCRDJnLZIyHhZpNjqNX9KUjAQZvpp7OKRzQ8yrNPzWPyKQqnVJbyzUi7ZIZnpy4i0/ YV4tc+1oUawl4xKmJ9aX03pWEAckIQWFifGdUXW8F4apeTfOXjGhi99OqSOxn5/ayQvi BtXy4sa3dGScUN0h4a3DBpt+KKPUaNQLeP1NQE6xDpAORKW6sfMrWFvY+yLmBcMis/Cw ezcQ== 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=nT9JMqdZL40d6DpIqTDz/AwubrwRPPy0W7SQItA5Q+w=; b=B1M9Gtijn0YqqpMN/VrIv5Hb608smgD1wfltzFx/4oxxj9y7JZUd146RhzDtLrE55T rOzNfQb1Hi/9aYhaB8fR9S4GmrNAUx7r09RspLUhRWaVVUvsXSCucrrewGWnpGkketRq C2uxM9BGxE2DwJg0TLcEwgFnH+nMvPJrFjYqNuOMX4l2zSRfXL5bt9M5SZ7JzOuT8+o5 nItrfqyd6GkzRc67T2kqUsdXqBvzgrp4k7QY2S3kmP1O/Es8LAwg5xVjIrTV9TyfdkSs M0vbxa+XE4qU1ExPiwTPHJY0cn8q6CFygQTUBONupF3C+RcVWBzwAgtrw5cXBjNzVmvV NgOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Yb3dlr6U; 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 p186si2548864oih.172.2020.01.29.22.45.36; Wed, 29 Jan 2020 22:45:48 -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=Yb3dlr6U; 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 S1726461AbgA3Goi (ORCPT + 99 others); Thu, 30 Jan 2020 01:44:38 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:4528 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbgA3Goi (ORCPT ); Thu, 30 Jan 2020 01:44:38 -0500 X-UUID: 7e56b355a92445ed8706ebd151455210-20200130 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=nT9JMqdZL40d6DpIqTDz/AwubrwRPPy0W7SQItA5Q+w=; b=Yb3dlr6UnD4Cx2R+Zz6bVPOpZG+iBOUPeZY6gohalqZGQPI5KjyuDefcwA5FNZYtWxXxV2w1pox9YJ5CzU0EdzknfZNUVyaVQDl9dya3bKFFpOq3RriVzj1JVEKmGzxae49iwix8P91gaXJMQNWUniCdnLswq4PtYlzH0JkWHF4=; X-UUID: 7e56b355a92445ed8706ebd151455210-20200130 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 636216165; Thu, 30 Jan 2020 14:44:33 +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, 30 Jan 2020 14:44:31 +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, 30 Jan 2020 14:43:35 +0800 From: Walter Wu To: Dmitry Vyukov , Matthias Brugger , Thomas Gleixner , Alexander Potapenko , Josh Poimboeuf , Greg Kroah-Hartman , Kate Stewart CC: , , , wsd_upstream , Walter Wu Subject: [PATCH v3] lib/stackdepot: Fix global out-of-bounds in stackdepot Date: Thu, 30 Jan 2020 14:44:30 +0800 Message-ID: <20200130064430.17198-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 Y2Nlc3MsIHNvIHRoYXQgd2Ugc2hvdWxkIG1vZGlmeQ0KdGhlIGRldGVjdGlv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