From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61BE3C5519F for ; Thu, 12 Nov 2020 19:27:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0235020A8B for ; Thu, 12 Nov 2020 19:27:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d77qtn8Y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgKLT1S (ORCPT ); Thu, 12 Nov 2020 14:27:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbgKLT1R (ORCPT ); Thu, 12 Nov 2020 14:27:17 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A01FC0613D4 for ; Thu, 12 Nov 2020 11:27:17 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id a18so5475219pfl.3 for ; Thu, 12 Nov 2020 11:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=d77qtn8YZRh/AQDOvMteWddTQy3QqcvCr4HFZmmE3hz1br3LMK/NbAG3k+k3xODi3/ ASmDD98lubGa9NJ8Wzq9bKaVt9JY3HKEfCzk1Qh0lFmf2QUIztT7WPPDaH0BUeoqbTnW xn7YIWG3wK1v+c4PTAtSNQ2k8ND/UsrXhn21Aa8zwn+oL90K4kZiCMSEsWBG2Bzbxj0E OFsIiTJa2sxHM1pLhsdmsrPH9ig+NRIOEAfJjt4L+pHacdAyKbjqyfjMPU2DTVON8YNl k1NkpxfgAzm4bQr8QVJioD816VUeh0n4KcQUFM1RBtdN9NR05kj470o+m4p6tMw2+ck/ vYxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=iIN0vsw39DhdxU2Xf3peXw799Vmc1tubOvEGYCQ3GjREx0oucLp4QmFTbpnuVC0XrC Q8br969sgzUaBtc5JTTGvYf6HenURdX6gpl0I7jWSseTz9j+S/dPXg3opHTKGnKcEhaP 1WaoeIoJY1NGU/0hzW5APDAbNyWOqxrMihW3/t0C/6GsX61TiC3H/dnR08bmGvC8tlKO BnIUDYCd2proFPOEbXS6PuvWzc4jHtiXCfHl9+dz9aYQABTQEf83219N1SoFKQXdChQX y8K0uIUmBHFvVxmuUw3APDshbGeXjfvbr2WXeaSrn1u4fHwRVrl+f7F3ua3jxqT0p/dK zgjQ== X-Gm-Message-State: AOAM531HNwpEgY++Bnf/kV+I+X14yEajnwU+SgvBqbcvaoeHqnKKgWWV eqvw+tZwHzEwUHImhUNVwHIXLraUgYdjrb99z8TTQg== X-Google-Smtp-Source: ABdhPJzGsAs7K5YmJeT7a5J9GmyJkaJyaoemUzPhUj2Gpuh+rkQNq9gc9pGSSZ642a8HYgxMYzcYgnpVxakIRaPJJ/I= X-Received: by 2002:a17:90a:eb02:: with SMTP id j2mr747894pjz.136.1605209236569; Thu, 12 Nov 2020 11:27:16 -0800 (PST) MIME-Version: 1.0 References: <49f7f2c12b0d5805f9a7b7092b986bbc2dd077a1.1605046192.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Thu, 12 Nov 2020 20:27:05 +0100 Message-ID: Subject: Re: [PATCH v9 21/44] kasan: kasan_non_canonical_hook only for software modes To: Alexander Potapenko Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Marco Elver , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 4:16 PM Alexander Potapenko wrote: > > On Wed, Nov 11, 2020 at 7:52 PM 'Andrey Konovalov' via kasan-dev > wrote: > > > > On Wed, Nov 11, 2020 at 4:09 PM Alexander Potapenko wrote: > > > > > > On Tue, Nov 10, 2020 at 11:11 PM Andrey Konovalov wrote: > > > > > > > > This is a preparatory commit for the upcoming addition of a new hardware > > > > tag-based (MTE-based) KASAN mode. > > > > > > > > kasan_non_canonical_hook() is only applicable to KASAN modes that use > > > > shadow memory, and won't be needed for hardware tag-based KASAN. > > > > > > > > No functional changes for software modes. > > > > > > > > Signed-off-by: Andrey Konovalov > > > > Signed-off-by: Vincenzo Frascino > > > > Reviewed-by: Marco Elver > > > > --- > > > > Change-Id: Icc9f5ef100a2e86f3a4214a0c3131a68266181b2 > > > > --- > > > > mm/kasan/report.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > > > > index 5d5733831ad7..594bad2a3a5e 100644 > > > > --- a/mm/kasan/report.c > > > > +++ b/mm/kasan/report.c > > > > @@ -403,7 +403,8 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, > > > > return ret; > > > > } > > > > > > > > -#ifdef CONFIG_KASAN_INLINE > > > > +#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \ > > > > + defined(CONFIG_KASAN_INLINE) > > > > /* > > > > * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high > > > > * canonical half of the address space) cause out-of-bounds shadow memory reads > > > > > > Perhaps this comment also needs to be updated. > > > > In what way? > > Ok, maybe not. I thought you were restricting the set of configs under > which this hook is used, so this should've been explained. > But as far as I understand, CONFIG_KASAN_INLINE already implies > "defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)", > doesn't it? > Maybe this change is not needed at all then? Ah, yes, you're right. Will drop this patch, thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78FFCC2D0E4 for ; Thu, 12 Nov 2020 19:27:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6E4A20B80 for ; Thu, 12 Nov 2020 19:27:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d77qtn8Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6E4A20B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C24CA6B0036; Thu, 12 Nov 2020 14:27:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BAE326B005C; Thu, 12 Nov 2020 14:27:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A75696B0068; Thu, 12 Nov 2020 14:27:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id 777196B0036 for ; Thu, 12 Nov 2020 14:27:19 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 232AE1EE6 for ; Thu, 12 Nov 2020 19:27:19 +0000 (UTC) X-FDA: 77476749798.15.roof67_2e1030a27308 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 038781814B0C7 for ; Thu, 12 Nov 2020 19:27:18 +0000 (UTC) X-HE-Tag: roof67_2e1030a27308 X-Filterd-Recvd-Size: 5710 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Nov 2020 19:27:17 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id g7so5488225pfc.2 for ; Thu, 12 Nov 2020 11:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=d77qtn8YZRh/AQDOvMteWddTQy3QqcvCr4HFZmmE3hz1br3LMK/NbAG3k+k3xODi3/ ASmDD98lubGa9NJ8Wzq9bKaVt9JY3HKEfCzk1Qh0lFmf2QUIztT7WPPDaH0BUeoqbTnW xn7YIWG3wK1v+c4PTAtSNQ2k8ND/UsrXhn21Aa8zwn+oL90K4kZiCMSEsWBG2Bzbxj0E OFsIiTJa2sxHM1pLhsdmsrPH9ig+NRIOEAfJjt4L+pHacdAyKbjqyfjMPU2DTVON8YNl k1NkpxfgAzm4bQr8QVJioD816VUeh0n4KcQUFM1RBtdN9NR05kj470o+m4p6tMw2+ck/ vYxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=S7eeGjtQzrxNLwtFFdeqc6II+lI26lzkcslNiptp7aqUMtmFIG4efJUVSTVTn+/ZRs xtdE0dmQmAAouxEnU25jEoZRYXEDbFu+0921pu0S0HEYfgNeHH5yATSr0KXtHqHlF2aw kLG2rLmaBrHUPU/D0dYxS+BQSNxEytA05tH7vLU14e7HCizu0Kj2O+0u8DTMbkxve8MY qBFaAKGX8KMESuwtzBL0/+mFlfcU+KATzCpKwcgvhuvFQc/6MXumr6oD4zTRyFUJhBv7 av5fEy/AvdTD6e1ZHO/TlCyVNBk5Pr3MtRUJGhV4RIHxuxC6ev8VOUqdKbCbZJOmSDgD +sEg== X-Gm-Message-State: AOAM5318mbwDaoRfMkxBm4uCo99XFn6tVBpMHMgBWdaeOMxiGzofeFbD +X7DdMv4h/lIsj5wxjjv3V9qvBSR52pkMMvrauUAUg== X-Google-Smtp-Source: ABdhPJzGsAs7K5YmJeT7a5J9GmyJkaJyaoemUzPhUj2Gpuh+rkQNq9gc9pGSSZ642a8HYgxMYzcYgnpVxakIRaPJJ/I= X-Received: by 2002:a17:90a:eb02:: with SMTP id j2mr747894pjz.136.1605209236569; Thu, 12 Nov 2020 11:27:16 -0800 (PST) MIME-Version: 1.0 References: <49f7f2c12b0d5805f9a7b7092b986bbc2dd077a1.1605046192.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Thu, 12 Nov 2020 20:27:05 +0100 Message-ID: Subject: Re: [PATCH v9 21/44] kasan: kasan_non_canonical_hook only for software modes To: Alexander Potapenko Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Marco Elver , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 12, 2020 at 4:16 PM Alexander Potapenko wrote: > > On Wed, Nov 11, 2020 at 7:52 PM 'Andrey Konovalov' via kasan-dev > wrote: > > > > On Wed, Nov 11, 2020 at 4:09 PM Alexander Potapenko wrote: > > > > > > On Tue, Nov 10, 2020 at 11:11 PM Andrey Konovalov wrote: > > > > > > > > This is a preparatory commit for the upcoming addition of a new hardware > > > > tag-based (MTE-based) KASAN mode. > > > > > > > > kasan_non_canonical_hook() is only applicable to KASAN modes that use > > > > shadow memory, and won't be needed for hardware tag-based KASAN. > > > > > > > > No functional changes for software modes. > > > > > > > > Signed-off-by: Andrey Konovalov > > > > Signed-off-by: Vincenzo Frascino > > > > Reviewed-by: Marco Elver > > > > --- > > > > Change-Id: Icc9f5ef100a2e86f3a4214a0c3131a68266181b2 > > > > --- > > > > mm/kasan/report.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > > > > index 5d5733831ad7..594bad2a3a5e 100644 > > > > --- a/mm/kasan/report.c > > > > +++ b/mm/kasan/report.c > > > > @@ -403,7 +403,8 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, > > > > return ret; > > > > } > > > > > > > > -#ifdef CONFIG_KASAN_INLINE > > > > +#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \ > > > > + defined(CONFIG_KASAN_INLINE) > > > > /* > > > > * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high > > > > * canonical half of the address space) cause out-of-bounds shadow memory reads > > > > > > Perhaps this comment also needs to be updated. > > > > In what way? > > Ok, maybe not. I thought you were restricting the set of configs under > which this hook is used, so this should've been explained. > But as far as I understand, CONFIG_KASAN_INLINE already implies > "defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)", > doesn't it? > Maybe this change is not needed at all then? Ah, yes, you're right. Will drop this patch, thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B60BC2D0E4 for ; Thu, 12 Nov 2020 19:28:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE25220A8B for ; Thu, 12 Nov 2020 19:28:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xmyLtBac"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="d77qtn8Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE25220A8B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=omRCZJI9dBojQUj6wR6SyevkT6hrgRWfElOpz6g1BP4=; b=xmyLtBacsW8V+IFq7P9Z5hFlQ 1KpFjkVgESTE9xJ6c+VoFEDprWZOrJCwpMLmN0aYKMq640eIae3VzD8ShZ7HOFtRmufukD5gf6ZnT V2gI7D88mhJWnJCRnXCp2v+BAxNZbQa+mB6qj/lD0Ycbaex9gcTfzFsOD6AUtGn1oftroaEMZffVy cxIsD03YZBAGelFebA/DKrUSgWNQ7FvYOD+nCQuQldfOR/k1p9SIZZHMfAu0999rCGrFLtMz/TpYl cl7f+pfjf5sdFxsxPf0xQ1KvRgseknzZVURj62V3zr/w9CdvF8t36792JS9sVA2dnWQjUGWClMcB8 9Qx7SqhnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdIFe-0000Hf-W6; Thu, 12 Nov 2020 19:27:23 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdIFc-0000GS-8j for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 19:27:21 +0000 Received: by mail-pf1-x443.google.com with SMTP id x15so4139813pfm.9 for ; Thu, 12 Nov 2020 11:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=d77qtn8YZRh/AQDOvMteWddTQy3QqcvCr4HFZmmE3hz1br3LMK/NbAG3k+k3xODi3/ ASmDD98lubGa9NJ8Wzq9bKaVt9JY3HKEfCzk1Qh0lFmf2QUIztT7WPPDaH0BUeoqbTnW xn7YIWG3wK1v+c4PTAtSNQ2k8ND/UsrXhn21Aa8zwn+oL90K4kZiCMSEsWBG2Bzbxj0E OFsIiTJa2sxHM1pLhsdmsrPH9ig+NRIOEAfJjt4L+pHacdAyKbjqyfjMPU2DTVON8YNl k1NkpxfgAzm4bQr8QVJioD816VUeh0n4KcQUFM1RBtdN9NR05kj470o+m4p6tMw2+ck/ vYxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xycyBHYzWiVaz+V9gLDQX6HE1E3HaoQ5YhnMfRsWwHI=; b=oleidEI1yPF+5daFpKV4bjb+y5XtT9aQUNXSLEq9et6MgdOovAPowhCLb06HFjoM8Q Olc1Jnw0gf0wwCQGisXSOXKmXMVrH6lPDfauFE+SmJksHTVMUSItuSUy/po8kDi7L5ZM 1TlQgFrjEZFZWavs5Q0O047OgLrLYbS6IB0p39M7bFvDdhLwvBFx353xUHqCyw0sj7pv hsxdY+cfcvgqjDZ78zY6LrPGwkSIL848L+cDGA7a4FwxtkS/z3J8vMOdZxWlpur+u5MC aPAIV5GgE4Vj9y/9fmzMBk0NNixw+xOgDXXRFo0gLRt0c7iSRBr8aLsBhxBnMpRD/vi/ R7jw== X-Gm-Message-State: AOAM530FU0lz74Yf659i78pQoeEgCMl/Tq6aAIe0+6Vrn32mRKK8n1AS agkx1uy8GYAnyUpgGWIZfpwIcGpYuhsxnZHDb4qX+g== X-Google-Smtp-Source: ABdhPJzGsAs7K5YmJeT7a5J9GmyJkaJyaoemUzPhUj2Gpuh+rkQNq9gc9pGSSZ642a8HYgxMYzcYgnpVxakIRaPJJ/I= X-Received: by 2002:a17:90a:eb02:: with SMTP id j2mr747894pjz.136.1605209236569; Thu, 12 Nov 2020 11:27:16 -0800 (PST) MIME-Version: 1.0 References: <49f7f2c12b0d5805f9a7b7092b986bbc2dd077a1.1605046192.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Thu, 12 Nov 2020 20:27:05 +0100 Message-ID: Subject: Re: [PATCH v9 21/44] kasan: kasan_non_canonical_hook only for software modes To: Alexander Potapenko X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_142720_368472_16FA504A X-CRM114-Status: GOOD ( 24.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Marco Elver , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev , LKML , Linux Memory Management List , Evgenii Stepanov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Dmitry Vyukov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 12, 2020 at 4:16 PM Alexander Potapenko wrote: > > On Wed, Nov 11, 2020 at 7:52 PM 'Andrey Konovalov' via kasan-dev > wrote: > > > > On Wed, Nov 11, 2020 at 4:09 PM Alexander Potapenko wrote: > > > > > > On Tue, Nov 10, 2020 at 11:11 PM Andrey Konovalov wrote: > > > > > > > > This is a preparatory commit for the upcoming addition of a new hardware > > > > tag-based (MTE-based) KASAN mode. > > > > > > > > kasan_non_canonical_hook() is only applicable to KASAN modes that use > > > > shadow memory, and won't be needed for hardware tag-based KASAN. > > > > > > > > No functional changes for software modes. > > > > > > > > Signed-off-by: Andrey Konovalov > > > > Signed-off-by: Vincenzo Frascino > > > > Reviewed-by: Marco Elver > > > > --- > > > > Change-Id: Icc9f5ef100a2e86f3a4214a0c3131a68266181b2 > > > > --- > > > > mm/kasan/report.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > > > > index 5d5733831ad7..594bad2a3a5e 100644 > > > > --- a/mm/kasan/report.c > > > > +++ b/mm/kasan/report.c > > > > @@ -403,7 +403,8 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, > > > > return ret; > > > > } > > > > > > > > -#ifdef CONFIG_KASAN_INLINE > > > > +#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \ > > > > + defined(CONFIG_KASAN_INLINE) > > > > /* > > > > * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high > > > > * canonical half of the address space) cause out-of-bounds shadow memory reads > > > > > > Perhaps this comment also needs to be updated. > > > > In what way? > > Ok, maybe not. I thought you were restricting the set of configs under > which this hook is used, so this should've been explained. > But as far as I understand, CONFIG_KASAN_INLINE already implies > "defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)", > doesn't it? > Maybe this change is not needed at all then? Ah, yes, you're right. Will drop this patch, thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel