Received: by 10.192.165.148 with SMTP id m20csp3257651imm; Mon, 23 Apr 2018 03:31:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49R2EuujV66OujJ3bUll9qSz4C9kEF6IAJPiyPlCS0/R5b89ZHokO9HoeB1IIHWrKM7f+h0 X-Received: by 2002:a17:902:6902:: with SMTP id j2-v6mr20010236plk.92.1524479476499; Mon, 23 Apr 2018 03:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524479476; cv=none; d=google.com; s=arc-20160816; b=l496AEJy8qHMvhOOtXQrPL/ZN6CnMgr9Xflfpc6Ohqdei+QEqzWe+ylnFfx4x2/7/l WV0tqVYf2R+2CpyDzI6pA6fROXpgqi7mAlhYZojJ+y8MpytFajAEw395x+NOlIVO7WlV 6DSc1Y++DNeBYXKwzxCzk3UGd/hJqEzu6yZuJezd2HW3GTJW0aJ9vpkt/yZIVe0nWyHF zr2E/4+4a7f02gS+xYRebYgCtUBEdI7uLK7Pz7w1TkNF8dOvVboIwL4hLzaV7AXQPjG9 WiUEZ/LbHC+RkTAfL/i7+a08pBwb2Uj3EvL3XjIXdycDqtqHddWnNl6KRncnSIS1K+xY ctzw== 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:arc-authentication-results; bh=gI9KObgm0Uo0xuOCdSe17FpJ1YKBGPeoivBf7SN6bL8=; b=HHeNz5+VRUV8+IwqDaiFIGtye+Y/N2mD98ZmQUlJ1l05h8C/vFguDXT6tJzb6Xd9e5 3WY59+obo0sZkK6xJpvBrumgcRo/TQIGjH4BMOcN68AkvnU4SWikFzhP+IusVucmTxSP 29L8Do4XM6BK0kimAax2rr89JtoV/e8Wf5AnENLZNEQPna0G/3TZj28paiGAMAHVkZau nGT1MFkmbQeqLzOMbZQJQZlanHXlEz6fhDxoHtWjlPOx5EGifRmDs1C5uLkmYYVBJloW Ab+urHmuNNftOISpDXQhB6ZNkS+vVtBH/85C9pb69KSGEAHFKV3oZ1EKE5ruFE8n+h7W ncTA== 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 p5si9422924pga.610.2018.04.23.03.31.00; Mon, 23 Apr 2018 03:31:16 -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 S1754694AbeDWK3U (ORCPT + 99 others); Mon, 23 Apr 2018 06:29:20 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38566 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754617AbeDWK3R (ORCPT ); Mon, 23 Apr 2018 06:29:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 215951435; Mon, 23 Apr 2018 03:29:17 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3AE03F4FF; Mon, 23 Apr 2018 03:29:15 -0700 (PDT) Date: Mon, 23 Apr 2018 11:29:09 +0100 From: Mark Rutland To: Jan Kiszka Cc: linux-arm-kernel , Linux Kernel Mailing List , will.deacon@arm.com, catalin.marinas@arm.com, suzuki.poulose@arm.com Subject: Re: BUG: KASAN: global-out-of-bounds in unmap_kernel_at_el0+0x70/0x1a0 Message-ID: <20180423102909.ra2n6tqvwcn7oash@lakrids.cambridge.arm.com> References: <97d99ad9-c5cf-a4d2-126a-2b39ffead0b3@web.de> <20180422190639.lyfvgnzapo2mrpu6@salmiak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 07:00:52AM +0200, Jan Kiszka wrote: > On 2018-04-22 21:06, Mark Rutland wrote: > > Does the below help? > > From ade322407e3d6d1f50e558ebd50d2c1c7bd811c2 Mon Sep 17 00:00:00 2001 > > From: Mark Rutland > > Date: Sun, 22 Apr 2018 19:58:08 +0100 > > Subject: [PATCH] arm64: add sentinel to kpti_safe_list > > > > We're missing a sentinel entry in kpti_safe_list. Thus is_midr_in_range_list() > > can walk past the end of kpti_safe_list. Depending on the contents of memory, > > this could erroneously match a CPU's MIDR, cause a data abort, or other bad > > outcomes. > > > > Add the sentinel entry to avoid this. > > > > Fixes: be5b299830c63ed7 ("arm64: capabilities: Add support for checks based on a list of MIDRs") > > Signed-off-by: Mark Rutland > > Reported-by: Jan Kiszka > > Cc: Catalin Marinas > > Cc: Suzuki K Poulose > > Cc: Will Deacon > > --- > > arch/arm64/kernel/cpufeature.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > > index 536d572e5596..9d1b06d67c53 100644 > > --- a/arch/arm64/kernel/cpufeature.c > > +++ b/arch/arm64/kernel/cpufeature.c > > @@ -868,6 +868,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, > > static const struct midr_range kpti_safe_list[] = { > > MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2), > > MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), > > + { /* sentinel */ } > > }; > > char const *str = "command line option"; > > > > > > Jep, all fine now! Cool. Can I take that as a Tested-by? Mark.