Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4755579ybp; Mon, 14 Oct 2019 09:31:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyek/kl8pcOHAOpq9DNu6Brkt1G7YRvUclTi5yRRTj1ujhfyCxfGzUT5QXaP7ILr4yQZwdG X-Received: by 2002:a17:906:82cf:: with SMTP id a15mr29729420ejy.279.1571070674825; Mon, 14 Oct 2019 09:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571070674; cv=none; d=google.com; s=arc-20160816; b=TI2gbb6aFppJYIr26pYUfSNsuUrjXUf3pr6oSxXwGOpy2RTZqB4IzNv3wM9gvjm3Y7 5QzrzDoJ1nPMqodaI70mhxb6LXEzxxJ/uVdz7tqXKKcrQJwmE4vTQI9KgvHuWUn56v32 4ol1jGqde8c0Vtag89XS3unWOxg+8MBGy0Z8bnthLgtPc5+159jtxnrWeqyUCeKih7QZ cWbUx2EAbxleKLf8vDCBqAiNALdVT78EvhmjY3YnEHJ9H/qhAnei3oTMO4TZsfuI8R6r azhieyzKpbiZa6aCMR8Y5VlJsVEx2g0Iaj8QYBPMJVT59xiJNVTu1m6nY/vDr9JVvJkx f7Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=y5ZlhoGEJVPYV8UeyWosgrzvDj1Ro60Iqic0DilBEO0=; b=qRRw+1+kBnuw1ZqjnlqPCqFq0OWD2fKUMj6YeVHPTSM2ESi0/xnDCL0ZPg02PXrio9 UrfI5n+5Q0cQa/x4bdJ55zuBpkmg7TrQ4KQbGc0Zw/+h/H6xTNESXdQq7D2wJmdpQjpm 5ePO+/wVEH3mvI3LSkx7c7nOVufRpwNkVY44lJvzBQrcNJynVXX3Vss03l5c10BngtH7 yhbLEqzwNUWty4m34E+Rm3WdrwQJvwIKHIuLNJhbh3F7JyXVkwimK8qLu0JTp9ng/KQK 70hDwjykDQczTbInJsquHB6Ll5B5wrNacXqkfoAU7RBiXn5o9+LaTeABxeB1uEqBT7+O 6cBw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 s17si11328746ejz.148.2019.10.14.09.30.51; Mon, 14 Oct 2019 09:31:14 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731783AbfJNP5T (ORCPT + 99 others); Mon, 14 Oct 2019 11:57:19 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:31203 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730102AbfJNP5T (ORCPT ); Mon, 14 Oct 2019 11:57:19 -0400 X-UUID: 82e2e07d42c8401c9fe66a906d53cd58-20191014 X-UUID: 82e2e07d42c8401c9fe66a906d53cd58-20191014 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1492891351; Mon, 14 Oct 2019 23:57:12 +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, 14 Oct 2019 23:57:10 +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, 14 Oct 2019 23:57:08 +0800 Message-ID: <1571068631.8898.8.camel@mtksdccf07> Subject: Re: [PATCH 2/2] kasan: add test for invalid size in memmove From: Walter Wu To: Matthew Wilcox CC: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , , , , , , Date: Mon, 14 Oct 2019 23:57:11 +0800 In-Reply-To: <20191014150710.GY32665@bombadil.infradead.org> References: <20191014103654.17982-1-walter-zh.wu@mediatek.com> <20191014150710.GY32665@bombadil.infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-10-14 at 08:07 -0700, Matthew Wilcox wrote: > On Mon, Oct 14, 2019 at 06:36:54PM +0800, Walter Wu wrote: > > Test size is negative numbers in memmove in order to verify > > whether it correctly get KASAN report. > > You're not testing negative numbers, though. memmove() takes an unsigned > type, so you're testing a very large number. > Casting negative numbers to size_t would indeed turn up as a "large" size_t and its value will be larger than ULONG_MAX/2. We mainly want to express this case. Maybe we can add some descriptions. Thanks for your reminder.