Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3214767ybc; Thu, 21 Nov 2019 05:11:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxuS2QBzB4lYcFQlY7BjqsSn4yozNxZl0Hwe8GAIbCLq6YU1cd7Xf+OP46U9WVUDDkIgRll X-Received: by 2002:a5d:6ac9:: with SMTP id u9mr10254684wrw.383.1574341870466; Thu, 21 Nov 2019 05:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574341870; cv=none; d=google.com; s=arc-20160816; b=bWzI2DTkHGPs5KGGa1L98fniI6BAXXMYXRRRApx9tYUsGjUvGqdj3j4anyrxiqtnB6 6NpMEZn1q+BiQgQqNnnp2lpFL8StWn1I3jdazZu+wf2zUxi5TmzHQMToifo+0zWcTPbU MecZt58l/TVfz269mC7LbvIYLJV7zS1dwlYg2Dw+oR/VxKTNOvV+qBBieUbSQtkAcukN EaV6OGS98iq0Honw6KtgSMjohvxweD8Z50qZ2h8D6Eii3KcSDfz1e8gLChIgz8oVvzc0 O8tbdKcs/wW2PauruxnFh/UbNjevgbhAIqWUQi13nO4xYAnMZ4rJGCY5LGgAmM38Od+k zsAA== 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=GKRpbk2ZaobBcrGmB5jVBprxNIO5Hbu7SfyTwGSrIKk=; b=NrBmokXsAlEZvTtg2RUM5l8mbEhw80EAqpD76wOZVHqqHjkZ/3QdXGv2fXUQ4/dlak gjy9rGDKWYZX9SFC8OVK8KPMZOvZxzVZTvT9/y/UPdkOsOheQ7tHJOJU3QK/fyPaSAQA tk3EIPmqW54Cd/j4yeHrCmPOW7KJf9GR1WrABXV8OhjMUD44pO9SZ1UsqbS44Wo7aCOn wjH1cpiXClmG7Pwxwujs4KYhYHGGudDb2oRK9XR9pkLeUKByEWb8UT8pfRX63VAnl/Sv Eyy+PrwsbGbUb9ZY5sXvvjfu8nTT1GTt8DR5I/viLlFyTGzl0t8kV5K+V0IPGbnfYBYX A1fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K8JOzSEH; 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 h58si2026536eda.18.2019.11.21.05.10.45; Thu, 21 Nov 2019 05:11:10 -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=K8JOzSEH; 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 S1727031AbfKUNJV (ORCPT + 99 others); Thu, 21 Nov 2019 08:09:21 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:58363 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726358AbfKUNJV (ORCPT ); Thu, 21 Nov 2019 08:09:21 -0500 X-UUID: 68b52b8743034574967e8b319804cedc-20191121 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=GKRpbk2ZaobBcrGmB5jVBprxNIO5Hbu7SfyTwGSrIKk=; b=K8JOzSEHkHL3MO8oyOwdXAKMIDqQpcxBEwEqlODopZEl7MFXIVymzFGDLqKxfOdWdz+LHf5P3vSb6Ev8xRUjc3ht/ru5qp7u3wwEn62wMugngeCHGIBNxYKJrFS3DSsAjRBqZ9xW9UcDmEt38gUd8ubGNI3FuTjP7915/GxBVws=; X-UUID: 68b52b8743034574967e8b319804cedc-20191121 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1392207874; Thu, 21 Nov 2019 21:09:14 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Nov 2019 21:09:07 +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; Thu, 21 Nov 2019 21:09:08 +0800 Message-ID: <1574341753.8338.7.camel@mtksdccf07> Subject: Re: [PATCH v4 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: Thu, 21 Nov 2019 21:09:13 +0800 In-Reply-To: <217bd537-e6b7-3acc-b6bb-ac9c5d94da89@virtuozzo.com> References: <20191112065302.7015-1-walter-zh.wu@mediatek.com> <040479c3-6f96-91c6-1b1a-9f3e947dac06@virtuozzo.com> <1574341376.8338.4.camel@mtksdccf07> <217bd537-e6b7-3acc-b6bb-ac9c5d94da89@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 T24gVGh1LCAyMDE5LTExLTIxIGF0IDE2OjAzICswMzAwLCBBb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