Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1797262pxv; Sat, 26 Jun 2021 00:28:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIwE3HslZDa6BwjGv/hND4ydv7mcp75VH6olPjyUlas1zaIzk89LmvfhSVyIokrsEf84+I X-Received: by 2002:a17:907:98fa:: with SMTP id ke26mr14880659ejc.309.1624692516830; Sat, 26 Jun 2021 00:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624692516; cv=none; d=google.com; s=arc-20160816; b=dWrEYRMfE1QfQxMYhcgE3GaIHqeenCi+5KTlmr+dnuskMo2HPFX5KGbSwhrLZqriu0 tJimpQZTEv+9EQ2UaxekC/ocyaU4x8Vgon1OI+3LnvP5pAgNC3rsWBMISB0/w/0W+Glb v8UqfQ6/EkRNxHPg+uVrCC+uFO7SoV+JNLBQn2Pnx+z28tIZ5CnkARGeM7b/pDEJf0mI RH+TXYTMgH4EY+UV169yuOSy0cZ16nRMtwAz97JHXX8sI46OqtYdChPP/ByLpZtcTlal nCEDc4NQ1q6mAqiIexywrBvcwCKB04nedFmYZ9WEPAtll9frfyUsqoUeYXFSUUNhPw4e JXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+6092CbLVlDNlltxJtqT/SQq75rzrcfImzqs7K8img8=; b=XkZFvH009rb2uwku3JaV/tuDtS/RQi4zVSlV9JIH3sgS8cGO2Vxp/ZU9h4OB0nyeCk 4FkhMICqrUc1KWIkvRQwmzlAaR8Th1EMLg6gzJb1+S3I1fg6wsFtzRjzDA14PCb/uDq4 CDhjQuq7ZVBFnmpHgkZHs3+/xihkrDFX9M1Ed9eV9qR1ICs8b9BBWEUXx84kdzf9UJTg FM4KOc3zntggL2iMusWxsin1BXZ3c+C7rmJ9MWZbwLET1HHc/junvDRMoV10i7Avxb6Y 1ebzaT9TPlfiVYil6KApvhHducyTidlP31s8ncBxsfBEWt2a9Y1gyZptCu4d+2dcIKRF 5lIg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si8330087ejl.715.2021.06.26.00.28.14; Sat, 26 Jun 2021 00:28:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhFZH3a (ORCPT + 99 others); Sat, 26 Jun 2021 03:29:30 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5431 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbhFZH3Z (ORCPT ); Sat, 26 Jun 2021 03:29:25 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GBlj962tnz74RW; Sat, 26 Jun 2021 15:23:41 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:26:58 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:26:57 +0800 From: Kefeng Wang To: Arnd Bergmann , , CC: Kefeng Wang , , , , Subject: [PATCH 0/9] sections: Unify kernel sections range check and use Date: Sat, 26 Jun 2021 15:34:30 +0800 Message-ID: <20210626073439.150586-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are three head files(kallsyms.h, kernel.h and sections.h) which include the kernel sections range check, let's make some cleanup and unify them. 1. cleanup arch specific text/data check and fix address boundary check in kallsyms.h 2. make all the basic kernel range check function into sections.h 3. update all the callers, and use the helper in sections.h to simplify the code 4. use memory_intersects() in sections.h instead of private overlap for dma-debug Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: iommu@lists.linux-foundation.org Cc: bpf@vger.kernel.org Kefeng Wang (9): kallsyms: Remove arch specific text and data check kallsyms: Fix address-checks for kernel related range sections: Move and rename core_kernel_data() to is_kernel_data() sections: Move is_kernel_inittext() into sections.h kallsyms: Rename is_kernel() and is_kernel_text() sections: Add new is_kernel() and is_kernel_text() s390: kprobes: Use is_kernel() helper powerpc/mm: Use is_kernel_text() and is_kernel_inittext() helper dma-debug: Use memory_intersects() directly arch/powerpc/mm/pgtable_32.c | 7 +--- arch/s390/kernel/kprobes.c | 9 +---- arch/x86/kernel/unwind_orc.c | 2 +- arch/x86/net/bpf_jit_comp.c | 2 +- include/asm-generic/sections.h | 71 ++++++++++++++++++++++++++-------- include/linux/kallsyms.h | 21 +++------- include/linux/kernel.h | 2 - kernel/cfi.c | 2 +- kernel/dma/debug.c | 14 +------ kernel/extable.c | 33 ++-------------- kernel/locking/lockdep.c | 3 -- kernel/trace/ftrace.c | 2 +- mm/kasan/report.c | 2 +- net/sysctl_net.c | 2 +- 14 files changed, 76 insertions(+), 96 deletions(-) -- 2.26.2