Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp869011ybg; Fri, 18 Oct 2019 08:33:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoUi6BE8m9uh3vsQyarl/AS0PzLS3Gpx+h06Ey0d/Ay1RImo8tOU6cFOme0dbGy3H9JZHP X-Received: by 2002:a05:6402:794:: with SMTP id d20mr10598944edy.240.1571412824711; Fri, 18 Oct 2019 08:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571412824; cv=none; d=google.com; s=arc-20160816; b=ZJd0ffmyuk3/BVq/uZLtBOp6XJJgy3Mdy5J0lVKMoVHGsA5R3AQRTrliv60Ip+lqpH 5AwOIbEZrE+vq1mHN0G4ziUyceGZTysWNnp7GEbxRuSYV/gP1TCkQR1j0EWe0+DlXDtc BRHii492H/zGCaNeEa3A7msz9Fiff/yZxOcurTw0jMxVPt3ikYYSrP0Q1e8ykukY3Jft vI3Zv46Bi6K+i9OmPLzDYJ2SUX+KF7eKkCDwJb5fHDK4aiWTYlonELYJ/KxsttjmKm8n YtiWcHXeCiy3TDKOSZW1pgSPkehHVhJbL6j6+nJ1hzLigHmUS/dFoSfGA7CCvSELXikb gP2A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=Zp5fRLEss7Fyl/pwKvu00BWLYsGYUo9c689ef2ZoZQU=; b=HDf9VITFhI7tseMcjT+rH83w35Y/7PewWPFEfB2Cc+x4BF7wcfQdkvt2s9SShMClrJ AOiTJGXS8l5/1KWE861PSHxtQRHf2pF5JD/I/89RVPfgwHYRkx/x6HtNJCxuR/jnh9tW t3OsnH4UnF9Bc8+ApVyjKi1ppP6g7Zq7wS/a5i4xfWgE+F31Pg6IJliWTu3Nax1aTbZH 3o6/EFTLd+EBY4AOAIIAvpLZUDj/Wn8x2wo6R9t9LEEuX7eJ5LA1zAdin9HsD2+G793I L0OnRERFZuFEMTct91KkEACbtWPdd8tJ3zvSiaWzrPNcGP/3g+yllVYDi0g4bqWIoor4 zzpQ== 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=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si4626095edk.157.2019.10.18.08.33.21; Fri, 18 Oct 2019 08:33:44 -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=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408904AbfJQKjd (ORCPT + 99 others); Thu, 17 Oct 2019 06:39:33 -0400 Received: from relay.sw.ru ([185.231.240.75]:43456 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408885AbfJQKjd (ORCPT ); Thu, 17 Oct 2019 06:39:33 -0400 Received: from [172.16.25.5] by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iL3Bf-0005sq-P7; Thu, 17 Oct 2019 13:39:19 +0300 Subject: Re: [PATCH v3 1/3] kasan: Archs don't check memmove if not support it. To: Nick Hu , alankao@andestech.com, paul.walmsley@sifive.com, palmer@sifive.com, aou@eecs.berkeley.edu, glider@google.com, dvyukov@google.com, corbet@lwn.net, alexios.zavras@intel.com, allison@lohutok.net, Anup.Patel@wdc.com, tglx@linutronix.de, gregkh@linuxfoundation.org, atish.patra@wdc.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org References: From: Andrey Ryabinin Message-ID: Date: Thu, 17 Oct 2019 13:39:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/8/19 9:11 AM, Nick Hu wrote: > Skip the memmove checking for those archs who don't support it. The patch is fine but the changelog sounds misleading. We don't skip memmove checking. If arch don't have memmove than the C implementation from lib/string.c used. It's instrumented by compiler so it's checked and we simply don't need that KASAN's memmove with manual checks. > Signed-off-by: Nick Hu > --- > mm/kasan/common.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/kasan/common.c b/mm/kasan/common.c > index 6814d6d6a023..897f9520bab3 100644 > --- a/mm/kasan/common.c > +++ b/mm/kasan/common.c > @@ -107,6 +107,7 @@ void *memset(void *addr, int c, size_t len) > return __memset(addr, c, len); > } > > +#ifdef __HAVE_ARCH_MEMMOVE > #undef memmove > void *memmove(void *dest, const void *src, size_t len) > { > @@ -115,6 +116,7 @@ void *memmove(void *dest, const void *src, size_t len) > > return __memmove(dest, src, len); > } > +#endif > > #undef memcpy > void *memcpy(void *dest, const void *src, size_t len) >