Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5507784ybp; Tue, 8 Oct 2019 04:05:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqztQs9V7yJ0L9+nn8RGcOgUqMkfyWsVu6upKWaANXz5/AyDZ6eHI2fg8D3mii+3mvEz6NGA X-Received: by 2002:a17:906:1248:: with SMTP id u8mr27360127eja.172.1570532753802; Tue, 08 Oct 2019 04:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570532753; cv=none; d=google.com; s=arc-20160816; b=f7kc+4KrZVSqc5L7GpthvQKhvQKbrMugTkBF4ZzIVN4epbr6KvZEnQ5v6v76FgwiuF rRr/usw6TqAALjLTezcBKZ8LYiByzjJeju3drU6rndBhVBTRpGDBkwbPID9qy2PW2f9n LyeTfthhV/JBj/HwM+mWpuLrQLd0j6llKxFt1VfdEJuQUqapJ4hZ6A1l2TCuw8fvEuWV mbwhOFUqOaa2BO2+ayTyPeAVXALfJT6v+uSSfDm7IlocQ9EjiIuzY8qO66+NH6CRG2md TXH+OHv4/F55l3D6LrF4iUGJ9zTAZ2Ylv0SZZG2uUwtJifk086Dp46MBHA/v0Wg+buu2 ThPQ== 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=niXLb4WE6D3jywSURJlr6nYe9PpS7j6WSx/C8tajXLg=; b=a0FLKW6sxBVldMhDZIWlU8QN0WjMrlXaTwtxnnQLtgetilIs7TWWLi0NOkmXUk0zu3 8OrgVmLSPe30m/F1GXnZ6zYURbUnLsxnG4drW4pmfaI0dAmafTBFN/COFMB4S5ktEtds 7jXHVwqTerMVDxbSD6ADI36SLc/WLrmMACV3SXY8DhX2nE/66sBjNjAWJ9M9QOq+FBrU re+KLhLntn5uA8YGq9S4LSeihpwOsAuV+YOIn0bluWMkX35N9wui/xkocTvJYxQvkkWw UGqTt33kfeN1YClV3LlATF5iR4CC30Lecg6oV3K/og5yvOV8r2VVC0FJQa5h09O06jWI V3VA== 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 gh3si8116042ejb.306.2019.10.08.04.05.25; Tue, 08 Oct 2019 04:05:53 -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 S1730511AbfJHLCN (ORCPT + 99 others); Tue, 8 Oct 2019 07:02:13 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:65258 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730118AbfJHLCN (ORCPT ); Tue, 8 Oct 2019 07:02:13 -0400 X-UUID: 814ed363ca79487d969aaa2a5840218c-20191008 X-UUID: 814ed363ca79487d969aaa2a5840218c-20191008 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 2095119737; Tue, 08 Oct 2019 19:02:09 +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; Tue, 8 Oct 2019 19:02: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; Tue, 8 Oct 2019 19:02:07 +0800 Message-ID: <1570532528.4686.102.camel@mtksdccf07> Subject: Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y From: Walter Wu To: Qian Cai CC: Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Matthias Brugger , LKML , kasan-dev , Linux-MM , Linux ARM , , wsd_upstream Date: Tue, 8 Oct 2019 19:02:08 +0800 In-Reply-To: References: <1570515358.4686.97.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 8bit 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 Tue, 2019-10-08 at 05:47 -0400, Qian Cai wrote: > > > On Oct 8, 2019, at 2:16 AM, Walter Wu wrote: > > > > It is an undefined behavior to pass a negative numbers to > > memset()/memcpy()/memmove(), so need to be detected by KASAN. > > Why can’t this be detected by UBSAN? I don't know very well in UBSAN, but I try to build ubsan kernel and test a negative number in memset and kmalloc_memmove_invalid_size(), it look like no check.