Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5493717pxj; Wed, 23 Jun 2021 02:26:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwlxjE48HzjmeNMxFjjWIQQBmLpElrQMDZSmjkppCLnjAs1ABiCZ9jZPPQeqkdugIbisdy X-Received: by 2002:a05:6602:134f:: with SMTP id i15mr6513882iov.143.1624440376541; Wed, 23 Jun 2021 02:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624440376; cv=none; d=google.com; s=arc-20160816; b=hP6OlBajqHIX+5joouIKdcMokF9tbzLlYmgOZvvFMr/A1ItQ3OPK65HBtEchJdejXE mO1+xmKoFovBvZNV+eGQ4oDCvSROTAbVhOxpTZR5QL6N9C3O9vCIKgZVcoOLB+AbAfSz qFy4AWUqahOroW7oJeNzNVXIkBUM/3y+DDAdaBU49ufNwZF5LSt85N1oTBaijoq+ue4Q 9HhP8CSX8j/S15QtnFWOCyetu5RRhyA2ymm94mu9k7vd7kh/WVZRagjsL91DPJSYILuS 40FyUCj7Ud3Jq1QcrcWW88xijUv5h3mX63L1Uywk2TQG9SucMMy6yTrEopq6p76BE58Y Esxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=ZT/7Ux0bhzXpS+rf3sIBrRKhCNZmq/T8COWEpsyT4vY=; b=L32bP3J8Wd/QXJ6Aoi0lsPitnphcoa63yzIkQDNjV5fBMBbVlS1ago/lm/3EodasTs 0gb6aZftlBlrunWwNitqanlXYUpl0jdkaDknVdBJwuvb+1aa7QkIrdhhqNbdcX1SNcy8 gLl3HfoZaeZthnfyB2xG9Jduc+kwfJVbC1TrjtBomy5DJseDJ2JuKyAAXZ3qhlDLhDRs +u8Jxa6s9YSdehvvGcythAB1Di/kfN1CpNURkHxyTThXIFVevyN4Nw/g0mRO8NxdPs2H ZJEZCLyT5+oGIYmmPVYWc6S3D6Iq8i2Msmj4bRneEVl53SoT5a2+5dn7l2iZOM1fSPsU tb+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b="jT/xShcV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si2385463jan.32.2021.06.23.02.26.05; Wed, 23 Jun 2021 02:26:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b="jT/xShcV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbhFWJ1e (ORCPT + 99 others); Wed, 23 Jun 2021 05:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhFWJ1e (ORCPT ); Wed, 23 Jun 2021 05:27:34 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE6E3C061574 for ; Wed, 23 Jun 2021 02:25:16 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id m17so850351plx.7 for ; Wed, 23 Jun 2021 02:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ZT/7Ux0bhzXpS+rf3sIBrRKhCNZmq/T8COWEpsyT4vY=; b=jT/xShcVdMcKeL4oR84DmNjF8Ol0x/t28pcCP6UWjmojgFpGCDTaWbUhUey+D9/VjC Fa1Y1LWPaxwZ54WdnRJaxarvAujXv6r//5mDcLAh6xR8aB6179P598fcqJpgFw/O8e9I yTn+mPdLFKs3Hhdq5aEBdwyy6yLqfaIjFuu+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ZT/7Ux0bhzXpS+rf3sIBrRKhCNZmq/T8COWEpsyT4vY=; b=kkX1SYDEPIklKBZyKaxve/o0Ed26a65QeozD+SrH5rjU6GmNlDD0GKwNgOhSUsHEDY UHLT7Ohh+Gb8K+wK7Olp8+bVmDeOS2PlIEUvyNo3zahhLgSYgKekA+U3r5p1ddhSOcSK 4zYFCVVpp1zSSBSwTM1LcIGYfuLstdtYk2ldvkqJjc9bDx4ctGUelBfm9Oz0ncRS8Jwt N+XO/ASQMlkQLYZkRxHUAve1e+OpM5+mAMLAZ1VEDC49s/Vq91LnmwX2PVFQYJzso4YI MsKNjEaLg+Oe8gTPbICE0l0a2ey/Ja2kAhRB1/wKhbaf32QMHeL22wuIgF3t7aDKuOTh bgWA== X-Gm-Message-State: AOAM533CQxAMnntf2pXIA2mcWl8E5neikou2i8O7fv8/clA3WISJ2hHV FyHS3jKbkgVmvIa+QU/mgVzjDQ== X-Received: by 2002:a17:90a:ee88:: with SMTP id i8mr8603384pjz.71.1624440316495; Wed, 23 Jun 2021 02:25:16 -0700 (PDT) Received: from localhost ([203.206.29.204]) by smtp.gmail.com with ESMTPSA id u10sm1860501pfh.123.2021.06.23.02.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 02:25:15 -0700 (PDT) From: Daniel Axtens To: Andrey Konovalov Cc: LKML , Linux Memory Management List , kasan-dev , Marco Elver , Andrew Morton , linuxppc-dev@lists.ozlabs.org, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com, bsingharora@gmail.com Subject: Re: [PATCH v15 2/4] kasan: allow architectures to provide an outline readiness check In-Reply-To: References: <20210617093032.103097-1-dja@axtens.net> <20210617093032.103097-3-dja@axtens.net> Date: Wed, 23 Jun 2021 19:25:12 +1000 Message-ID: <878s31hr0n.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> diff --git a/mm/kasan/common.c b/mm/kasan/common.c >> index 10177cc26d06..0ad615f3801d 100644 >> --- a/mm/kasan/common.c >> +++ b/mm/kasan/common.c >> @@ -331,6 +331,10 @@ static inline bool ____kasan_slab_free(struct kmem_cache *cache, void *object, >> u8 tag; >> void *tagged_object; >> >> + /* Bail if the arch isn't ready */ > > This comment brings no value. The fact that we bail is clear from the > following line. The comment should explain why we bail. > >> + if (!kasan_arch_is_ready()) >> + return false; Fair enough, I've just dropped the comments as I don't think there's really a lot of scope for the generic/core comment to explain why a particular architecture might not be ready. > Have you considered including these checks into the high-level > wrappers in include/linux/kasan.h? Would that work? I don't think those wrappers will catch the outline check functions like __asan_load*, which also need guarding. Kind regards, Daniel