Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp173500ybc; Mon, 11 Nov 2019 22:55:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy28ptUyutyJcp4FkdyiTLWMDlFKPhtof+EtN+WkkqsMFU0Myi211JRPOK2RaYVUADkz9tV X-Received: by 2002:a17:906:f756:: with SMTP id jp22mr26187656ejb.234.1573541716135; Mon, 11 Nov 2019 22:55:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573541716; cv=none; d=google.com; s=arc-20160816; b=wX5KtVSaXBtG5xzGIPRoMzo3wrLiDQ7rkM3+Dd2olTuDBQqxIbw5ICpJpqzEcK/VzG EUGB5p7P7zlkMT5JSEU9hXFdNz1uuYuZQT6bSgYwf/175XTSg/iKJtTV5f1VB7FPFvty 4MbqY4dz/fxucUCRfzN7LV5G5XF6Da6NQ4AprTSR//rBdyDiZUHWZNbd3UK74HjfnALZ sq8F/2tJaH7fcJf3DM5WLoGkAp4lUxJhCeR0tYaSnxyJkrudJn50HXPgZ1mPASwXCfhY rjk0LUA1q39rJOD8rm1HZ34lTKZeHUecBocm7yjpO2hLEpS368vrtJcnOWxFqHa0CXXW CoOA== 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=ajKp09d7IkN8w+Fz8lu3IvhtATq24/kTWameVprGZZI=; b=S2jrs2aBXKiHFqM71q7khTNwvPkwBNvPmKwb5mBmusr1Wxxqh5l58QUn+hHVpL0FMJ UzNZ8b+jXwhPQjnnWuwVYGx/rRbv/HKDGqeKFs1wpiA/vvsmvrHdXwxqfBt9tNhzV8b+ JPU88YE0o3qfQWXyFTXtc0a1JL1sTxQbLXPxcMHh+IJjFl8cJ+82untoY4U4qQC1Nug3 WurCTUIk8z6p4UMJ1XoJItPSgcLDS9krD6xAE5Ma679ICtf2OgmEJYL2/DltbioPdH42 hB5s9ZLwMGf+v+67gQQuAX6sTygrh1yLlebSZ44cHFQdJvE28iEo7AtUbWg64m76IGgG DShg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="OAk/h7tY"; 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 x19si10931880ejv.94.2019.11.11.22.54.52; Mon, 11 Nov 2019 22:55:16 -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="OAk/h7tY"; 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 S1727487AbfKLGxO (ORCPT + 99 others); Tue, 12 Nov 2019 01:53:14 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:61838 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727031AbfKLGxM (ORCPT ); Tue, 12 Nov 2019 01:53:12 -0500 X-UUID: 6ed53018ad224b42b8a8ab472c12c54c-20191112 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=ajKp09d7IkN8w+Fz8lu3IvhtATq24/kTWameVprGZZI=; b=OAk/h7tY0mMyuU0aoKjit1iC1YDZE0DaH/VUBEkZwwil8DVz5zgGzUspcmrnCARxoXvmOQo1ywP1SaP5ds7q92fzbSVBHQ6PJDC2Hwv2EDZvrTeft4tjbd7uHq9uAm4TNUZfezl35U5iTCIx0SjxrhZ1GPNypVMnHGBX56B3Qwo=; X-UUID: 6ed53018ad224b42b8a8ab472c12c54c-20191112 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1234647263; Tue, 12 Nov 2019 14:53:04 +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; Tue, 12 Nov 2019 14:53:02 +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; Tue, 12 Nov 2019 14:53:02 +0800 From: Walter Wu To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger CC: , , , , wsd_upstream , , Walter Wu Subject: [PATCH v4 1/2] kasan: detect negative size in memory operation function Date: Tue, 12 Nov 2019 14:53:02 +0800 Message-ID: <20191112065302.7015-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 S0FTQU4gbWlzc2VkIGRldGVjdGluZyBzaXplIGlzIGEgbmVnYXRpdmUgbnVtYmVyIGluIG1lbXNl dCgpLCBtZW1jcHkoKSwNCmFuZCBtZW1tb3ZlKCksIGl0IHdpbGwgY2F1c2Ugb3V0LW9mLWJvdW5k cyBidWcuIFNvIG5lZWRzIHRvIGJlIGRldGVjdGVkDQpieSBLQVNBTi4NCg0KSWYgc2l6ZSBpcyBh IG5lZ2F0aXZlIG51bWJ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