Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp824340pxb; Thu, 5 Nov 2020 14:07:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwP+XP4aEVyLybeu5ymjDZrkNBUmrLtEdryoCjqc+vC3fT7yHvBjP0EqQO+JAHOF2qzQTy X-Received: by 2002:a05:6402:1585:: with SMTP id c5mr4730149edv.372.1604614062108; Thu, 05 Nov 2020 14:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604614062; cv=none; d=google.com; s=arc-20160816; b=Hrt14VwhmGiwOnMTIQHRHF+JzTvJGCKNlIrLM5mCMDQbwin0LAFhB7mMV2MQq5anVW 6GhUr3YsxEdwNqM+93TmESndfvvadJv0qW7ymkBwx5sbBjylxRD3nm1SeN7duuCB+NHf +Bk3KhUwst9saIrOKkGxqauK9abAyTh24ph9PCt6SgXfnGciJ8J+w0k0n+y5cbDXXeRy Lj8LsoHXNPE1C1Q/hwqwFH0Sjn2pxhlUgYBWGGAb0t3IcMC9LCJkC5orqBTS60QIDjj1 JwEyBYwgT8YHrvG6t4Sjw1jq0JbE2/ge2LcZmskbGOQavxaGWJCPCudXk/rE2beaSgKq Cxww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=NpTrVAaJNTJ86VpfcHc4IkZdS3FrlhuPnYjUt994fC0=; b=1KDioHY0WsnwLq51/fVc/OavssOyeyO8ZyyFTfyvZn8C/cLe+urVwmGs0IAG7dLSL8 bTU6AQ2XIDGIAbhs5+fe7ANKk/wSeYRANp41lzsvAiEIosB5mXqAR8EJCdiwMH/mGrI5 vgiBqZF33WJENPQx0iiOPbxZ30SFA88Tt8JqsUTiDNg7SElkJGEQyoeOvEtYifQBpIK/ JA2SowGRGFXLXKxMDSr6ujQ7Xr4GgFTip4cEa1Eg54lpmV2ueG682ktCvoO35JeFsfZB Xj0iUJvXmfZHD26m2BrlX9Xh15NB9jvJxs5ocSQ2EpdmXQytM3T9Btu1j4YlDu7OmfE/ 1NNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ztmRX1Ph; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si2545552ejv.461.2020.11.05.14.07.19; Thu, 05 Nov 2020 14:07:42 -0800 (PST) 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=@kernel.org header.s=default header.b=ztmRX1Ph; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732600AbgKEWD3 (ORCPT + 99 others); Thu, 5 Nov 2020 17:03:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:59860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731508AbgKEWD0 (ORCPT ); Thu, 5 Nov 2020 17:03:26 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44E202078E; Thu, 5 Nov 2020 22:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604613805; bh=yfxqBAJW6/shUdb+BnOHVcqxW2ysmnc9li46q11PNN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ztmRX1PhJRcwmcT0VroP/YFjzquVUgXDwWVJlWl360EK2EY5EyNN+983LwBWZ+f0w 92qm6908xX68IEAeHUTZk8DeHy1DP6vi68ISiof81GyK+AvRQhn71vh0wZcMFWfEfr JBiH4Eh+yJIFWwxAB+UxjYXpcnbTGTUKfhqtYre4= From: paulmck@kernel.org To: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, kernel-team@fb.com, mingo@kernel.org Cc: elver@google.com, andreyknvl@google.com, glider@google.com, dvyukov@google.com, cai@lca.pw, boqun.feng@gmail.com, "Paul E . McKenney" Subject: [PATCH kcsan 1/3] kcsan: selftest: Ensure that address is at least PAGE_SIZE Date: Thu, 5 Nov 2020 14:03:22 -0800 Message-Id: <20201105220324.15808-1-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201105220302.GA15733@paulmck-ThinkPad-P72> References: <20201105220302.GA15733@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marco Elver In preparation of supporting only addresses not within the NULL page, change the selftest to never use addresses that are less than PAGE_SIZE. Reviewed-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- kernel/kcsan/selftest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kcsan/selftest.c b/kernel/kcsan/selftest.c index d98bc20..9014a3a 100644 --- a/kernel/kcsan/selftest.c +++ b/kernel/kcsan/selftest.c @@ -33,6 +33,9 @@ static bool test_encode_decode(void) unsigned long addr; prandom_bytes(&addr, sizeof(addr)); + if (addr < PAGE_SIZE) + addr = PAGE_SIZE; + if (WARN_ON(!check_encodable(addr, size))) return false; -- 2.9.5