Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5860283ybx; Sun, 10 Nov 2019 23:16:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxBmyk2cDQnUzilfH83Bp5KaX3xaxKSSx2Ns2HOPfeduiEowErRYTHiIUakS7+dDjzUfPCc X-Received: by 2002:a05:6402:7cd:: with SMTP id u13mr24406556edy.246.1573456564893; Sun, 10 Nov 2019 23:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573456564; cv=none; d=google.com; s=arc-20160816; b=yHiCcx3uqZlSRdqcECRthgBt6SDAsIVvvrQFB9zigSBesiTHZZDgAbCPHGQ0L0E90p GTIeAoGV9Zcenc/IhlQar10mRdbzYd54B6DWjFExqPaH6FT693IEpWiN8oU89KiYu9DG a82Seob4IRXXa3cFRi4Ck0Qmf5HleiYpviIqo2CJ51tFTCer16Yz60UQpQwHwASyw532 gFQlWBhfS8F9lpq2vD5tK6U7X0A/6WI/UuZpfnEkIvCVNoFkmHlcA11bAjTOuGc9x957 b7l3g7uq2njTyp+YcQnzEgwHPkzwhn+zgwhkRasROQ1PlWWxfAq63V9PX/YVPQeYq+jb RYpA== 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=ZET29UGGhorDG5MNMT5K7ddGjyv/P0hiwCQLJxUqtP4=; b=gafDNyg3HCDdDLo33H18GBhD5VnbcoO11mKRmv/NiI3EcH3mOrGsTxegnGxuWFZps/ o44Ju1RBpOO3Y24jsQDlmLs4gCdgYvhFsXWfBQ6xbxIfsoYaSym1Znaay+tCP2uzLdOU n1HLUdh1DHrGQw9kL7NU/c2YOXxILyaehdUo92I07IcWK1rKPkx7w5MfHVVPPHN7Vdc2 b+h4IgqBmFNj/wDj+lM+y2tZE+Lynk1XRooI03eMyWY2PDZnO67UQ1eW3R81kbBHSoi4 NLs7jI10fpoHp0DFEwKR8doM2Lqj30O4USHbaB5U5U7Fcic5wCZn8GTjcy76q2agxls/ F/EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aPVHgi82; 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 g6si10280723eda.377.2019.11.10.23.15.41; Sun, 10 Nov 2019 23:16:04 -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=aPVHgi82; 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 S1726791AbfKKHOc (ORCPT + 99 others); Mon, 11 Nov 2019 02:14:32 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:58559 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725812AbfKKHOc (ORCPT ); Mon, 11 Nov 2019 02:14:32 -0500 X-UUID: 53c84c1b40474be08d6072da63118f33-20191111 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=ZET29UGGhorDG5MNMT5K7ddGjyv/P0hiwCQLJxUqtP4=; b=aPVHgi82AH2ACnByaoYvGuHl4DEhcbZrnEjU57fAmRqjgqninzURpz/dwuWPPgCoxE9ckxQsBLIrSsSMavL1YEwsxR2WAg1QpnK7edrP4wpkj9lZJHzOGVI6mCPKihhcWoLaR7g+w6EX/O14h+IQgCffE1UbovoLLf38ktA8Kjw=; X-UUID: 53c84c1b40474be08d6072da63118f33-20191111 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 1852812815; Mon, 11 Nov 2019 15:14:26 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 11 Nov 2019 15:14:23 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 11 Nov 2019 15:14:22 +0800 Message-ID: <1573456464.20611.45.camel@mtksdccf07> Subject: Re: [PATCH v3 1/2] kasan: detect negative size in memory operation function From: Walter Wu To: Andrey Ryabinin CC: Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , , , , , wsd_upstream Date: Mon, 11 Nov 2019 15:14:24 +0800 In-Reply-To: <34bf9c08-d2f2-a6c6-1dbe-29b1456d8284@virtuozzo.com> References: <20191104020519.27988-1-walter-zh.wu@mediatek.com> <34bf9c08-d2f2-a6c6-1dbe-29b1456d8284@virtuozzo.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 T24gU2F0LCAyMDE5LTExLTA5IGF0IDAxOjMxICswMzAwLCBBbmRyZXkgUnlhYmluaW4gd3JvdGU6 DQo+IA0KPiBPbiAxMS80LzE5IDU6MDUgQU0sIFdhbHRlciBXdSB3cm90ZTo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