Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp34011pxa; Mon, 3 Aug 2020 21:50:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjI5tgLqZ0eXWtoh2Dkak0wLy8hTjrRpPaYgf/84TSrKZsTsLzs/A44UUdV7xe2aCSgcSe X-Received: by 2002:a17:906:2f07:: with SMTP id v7mr20575620eji.313.1596516641687; Mon, 03 Aug 2020 21:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596516641; cv=none; d=google.com; s=arc-20160816; b=O8I/BmeIerI9zI9/2938piRt9aF+oWCa7tJFeDBWJnOpFmTd+zfB4trThEXHv+czzz MpJWF6Wt3cCyJLWsZYwUkmOAjlt8RNZ7uFUu8tlWeq0A/K0kQLjn6oXnFMQPAbV7M8nF rEDxAepzoLK1sEqyan5q3vyxF6WxUnZbfhYzTzE8c9a2iRXKSgKEI5Urkgd0chf78OZv ybOrBMUOnv9vfawJQwLR0ZdWYh2XW7NhOnt2i3nsf6ST2v2hmmOWefXaero6UEyJuP+c egfRiBl57wXeW8JirN7niCxrahvxURRu4f8nLLs+mhZh16ewNPzuB4wxjyMxdr4OKX3x X1kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=brruNto447gdGe8l1KSPKI5nKJ5Ysuz0ADqZU4+gCh4=; b=QUJOtV/s0khYLyS8//+ZhIWWqCVOTV6MYC+q6sMPGav8CbNUsOCM4x6o5jtQGyHZ0T y1lfAuiJcC1v4oxF4ThPyInNb5/RmUt3lyAjeTpZC9arPZ1yYVdG3W3+s4rqdWYsIe82 Lm8yJY6c1LVjjJfyIlM6hXRWAeOPuc+dcV+e4IVNBNFLqu9REhcN1mky/jvAzGc61nEL 0Uy0kyPX+I4h49kY7Bzk06ylGev6UAHXcr7lQ1QenKb0NaOw1BDT2LKAAsH6LlzvCQ3q HU2HpX31/9KLYZSAkiARIDGbeK8Lb8nCfASQ9YtCX8fvVEuBtu7V8OR8797B7rxrjbuN SEIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aInUy2l/"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si13190103edl.132.2020.08.03.21.50.09; Mon, 03 Aug 2020 21:50:41 -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=@redhat.com header.s=mimecast20190719 header.b="aInUy2l/"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729781AbgHDEty (ORCPT + 99 others); Tue, 4 Aug 2020 00:49:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57637 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726000AbgHDEty (ORCPT ); Tue, 4 Aug 2020 00:49:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596516593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=brruNto447gdGe8l1KSPKI5nKJ5Ysuz0ADqZU4+gCh4=; b=aInUy2l/iCOB5KOzTxMIPNarUgyJ/RctbVA5sLiR3SQzmHfpdLKP59Y175Ehx4G4XfgCvv 2YuSlVNmBv4hrGL+PWzVxFFgisUtmrzeBfRLp2KXfl5INw1jyHrE447uda56goBWwNPF1d ND3sVAGRmH9VMxFkTidM/Nj2P5pXA0k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-f67KdJOHOo-JCm-z6MgtJA-1; Tue, 04 Aug 2020 00:49:48 -0400 X-MC-Unique: f67KdJOHOo-JCm-z6MgtJA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3E98E91B; Tue, 4 Aug 2020 04:49:47 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C42E10013D7; Tue, 4 Aug 2020 04:49:43 +0000 (UTC) From: Lianbo Jiang To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, tglx@linutronix.de, bp@alien8.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, dyoung@redhat.com, bhe@redhat.com, k-hagio@ab.jp.nec.com Subject: [PATCH 1/3] x86/crash: Correct the address boundary of function parameters Date: Tue, 4 Aug 2020 12:49:31 +0800 Message-Id: <20200804044933.1973-2-lijiang@redhat.com> In-Reply-To: <20200804044933.1973-1-lijiang@redhat.com> References: <20200804044933.1973-1-lijiang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's carefully handle the boundary of the function parameter to make sure that the arguments passed doesn't exceed the address range. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index fd87b59452a3..a8f3af257e26 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -230,7 +230,7 @@ static int elf_header_exclude_ranges(struct crash_mem *cmem) int ret = 0; /* Exclude the low 1M because it is always reserved */ - ret = crash_exclude_mem_range(cmem, 0, 1<<20); + ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1); if (ret) return ret; -- 2.17.1