Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1241994ybl; Fri, 23 Aug 2019 16:02:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYf96dFavikQ1lKzK8Rrsio0M00SK+BuhrrnXf0IYoJbTYphAXHj/Ud5g2kw2Dl3cYcIRV X-Received: by 2002:a65:430a:: with SMTP id j10mr6192224pgq.374.1566601367043; Fri, 23 Aug 2019 16:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566601367; cv=none; d=google.com; s=arc-20160816; b=CtL6MLLtCEo1J0uPZbj8IsERAA0PEnEgEkRM9uMfa6k6io4OXiGsL+q1HGYa0tJ7+M +Xx60o7bdKiogN7y+n+ecobDpoA9U2cP6l7vEZfmy2xIbos3kCCHv+t2awxmNgXJ7QMs DwCTZGqIbNnTyHIgVZyUaU+2wyIpEbFbKxN0P/yhvFhsYD0BB5p6AFYxh3I5r50wJWVF rHB9zAJXRKoJvvdZzAIybdqByKh0ImhJpVfEddvL8GO2evXx5V+JlUlI1ePTgqCshUN1 B5/UcgmS6VngaUU7p805Nqmu09FAuGuwzVHXIMMfMlWbiEzyQfr9Xtiyf8DvLep4Kbt4 Crow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vCA8bQchGyDJm6i1DTiFCZwAq8pVo8Ol0wECpRoQzJE=; b=PJsQgXj5ycpI51dmnxVI5lOtw1ns2adOynffRnCHa9UMWzAMv0VgLi76ArxQR56Q6z XQsjpAYgilhnSKWjvFYlTU8EIoPxg2ioc6ScCAclTeKl2I5cZLfYTMAtZVPCCauw4JUL OStWm8EzOUIfw9ym+UOV5T9Pydvbq3/zzKsN2pTHshrSXgWkaGpmsqcIZk7weJA5tZFU e2SGM/1O/GxJ9tV8XibsD7UTaGBNXcElmlZzWquvq7O9osLOm7ChgLFvje0OmTt4ebhn Z2dlp1ki11rYyP5EyBOPCH+G3PwIx3hVWaw++krrdS09Yxs3daOLnzytzp2WpCI+mZAP RSBg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si3456710pjx.75.2019.08.23.16.02.32; Fri, 23 Aug 2019 16:02:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388464AbfHWKlR (ORCPT + 99 others); Fri, 23 Aug 2019 06:41:17 -0400 Received: from foss.arm.com ([217.140.110.172]:59856 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbfHWKlR (ORCPT ); Fri, 23 Aug 2019 06:41:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C492337; Fri, 23 Aug 2019 03:41:16 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 739C63F246; Fri, 23 Aug 2019 03:41:15 -0700 (PDT) Date: Fri, 23 Aug 2019 11:41:08 +0100 From: Mark Rutland To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Alexander Potapenko , Andrey Ryabinin , Dmitry Vyukov , Will Deacon Subject: Re: [PATCHv2] lib/test_kasan: add roundtrip tests Message-ID: <20190823104107.GA55480@lakrids.cambridge.arm.com> References: <20190819161449.30248-1-mark.rutland@arm.com> <20190822164857.460353a8195bfd5ddb3d5f50@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190822164857.460353a8195bfd5ddb3d5f50@linux-foundation.org> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Thu, Aug 22, 2019 at 04:48:57PM -0700, Andrew Morton wrote: > On Mon, 19 Aug 2019 17:14:49 +0100 Mark Rutland wrote: > > > In several places we need to be able to operate on pointers which have > > gone via a roundtrip: > > > > virt -> {phys,page} -> virt > > > > With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the > > {phys,page} -> virt conversion will use KASAN_TAG_KERNEL. > > > > This patch adds tests to ensure that this works as expected, without > > false positives which have recently been spotted [1,2] in testing. > > > > [1] https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh.wu@mediatek.com/ > > [2] https://lore.kernel.org/linux-arm-kernel/20190819132347.GB9927@lakrids.cambridge.arm.com/ > > > > > > ... > > > > The only change I'm seeing from v1 is: > > --- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-v2 > +++ a/lib/test_kasan.c > @@ -19,7 +19,6 @@ > #include > #include > > -#include > #include I think you've confused v1 with v3 (which was the first version to include ). v1: https://lore.kernel.org/linux-arm-kernel/20190819150341.GC9927@lakrids.cambridge.arm.com/ v3: https://lore.kernel.org/linux-arm-kernel/20190819150341.GC9927@lakrids.cambridge.arm.com/ I guess as v1 was part of a reply (without the mail subject matching) that might have confused things? Sorry about that if so! > > /* > > which is really kinda wrong. We should strictly include linux/io.h for > things like virt_to_phys(). > > So I think I'll stick with v1 plus my fixlet: > > --- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-checkpatch-fixes > +++ a/lib/test_kasan.c > @@ -18,8 +18,8 @@ > #include > #include > #include > +#include > > -#include > #include > > /* > Assuming that you mean *v3* with that fix, that looks good to me! Thanks, Mark.