Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3897371pxv; Mon, 19 Jul 2021 11:25:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCsrXVvnq1UKg+tsrLJzqdoUG+8YRwXVFinixQAwHA3JfyxWqPk0Cg55ZXP/36AS1H+ygI X-Received: by 2002:a05:6638:204c:: with SMTP id t12mr22825744jaj.129.1626719112642; Mon, 19 Jul 2021 11:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626719112; cv=none; d=google.com; s=arc-20160816; b=WBiq8a1V/hWi12NAaDpVO3HYSP6DRxOX5nbtcMYr3+vxtbMfrB0Y1pz4YyUV0i2Kge vtPZXo9AWMHuLkvoKRGbWxn6mFqkcqdu4qbuJDQqpS04+tpy3SQfG2EabYL8QIYAQAIX IGAJv50AG5nRCP1fvDb3sdmZQqAWLdsPq5nFarUHPHjzmHXsWbTP82zVkpXMgEA/uNI4 R9kr1yGltjhhC8qmDhfr5ij8N6VkdgDcanR/xucHxmu8MiMMQIdKGBj7l7Vx1PmUnVTl SDyngqIN71J9JqqtqpjKoeRrUn1DbgVJD9F5Z5VR6nADzWfITNqexgdZ+Zyb4PrOOPCg JwCQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pTUz8NXdcoDbMfx6cCDMsfVRkCTuwDbUgwAyQ723obM=; b=gnTRSTqyyQRnWvjrp3N+0yjAgGsjk1EBu8Qn3dYUIN5cbhQcKCOfR7YuGfw6YvvjST i8pqHd3wg49SzRsxcTgKrZBiiqXbvUMrcPX+gmV99C38vyIUXT/zirm2dlIvC293vhPW xkg5sCJgFfpOYklmy+DEv7sgCCttplA4+MPDYv9rDXcCp9lOIMv+51CalWPd0/9b16j/ NFkZ36PnA0ramfpLN+t/RJ08/nJRPGVcvqUAkaq8vGNYpPgnDC7Ve8RSSRrFN4C9cJhV yd4bUQ5F1Vi9/Y75ooYwcGbJAM+GQeOHgTCEzMt/OFM8V/rgyGLckpfPYnge9924zHdg vRBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kKWBxVEB; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si20577400jak.34.2021.07.19.11.24.58; Mon, 19 Jul 2021 11:25:12 -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=@linuxfoundation.org header.s=korg header.b=kKWBxVEB; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380672AbhGSRgJ (ORCPT + 99 others); Mon, 19 Jul 2021 13:36:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350477AbhGSPvE (ORCPT ); Mon, 19 Jul 2021 11:51:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0784D613D4; Mon, 19 Jul 2021 16:29:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626712184; bh=92c8Rd7bHo8sgZbesvkfwofkpXsdN3X7DxtbI5w4RfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kKWBxVEBC2zXEXStImgcyBrHDnYn9lHSaldee0Rw/W9uwYZNcZqWJ3WFG1GHtsoDJ oE36rjAEPvgpqvpAg3PN8omvlVlIpA/eL8axYk+BGMZmLL014kzbt6SZNW2AY+qggX zDUOLzLJRw8DiBp8HJZFDyZWIbwBB+GvOlFiodXk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Masami Hiramatsu , Ingo Molnar , Sasha Levin Subject: [PATCH 5.12 282/292] kprobe/static_call: Restore missing static_call_text_reserved() Date: Mon, 19 Jul 2021 16:55:44 +0200 Message-Id: <20210719144952.187081894@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit fa68bd09fc62240a383c0c601d3349c47db10c34 ] Restore two hunks from commit: 6333e8f73b83 ("static_call: Avoid kprobes on inline static_call()s") that went walkabout in a Git merge commit. Fixes: 76d4acf22b48 ("Merge tag 'perf-kprobes-2020-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") Signed-off-by: Peter Zijlstra (Intel) Acked-by: Masami Hiramatsu Link: https://lore.kernel.org/r/20210628113045.167127609@infradead.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- kernel/kprobes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 745f08fdd7a6..c6b4c66b8fa2 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -1569,6 +1570,7 @@ static int check_kprobe_address_safe(struct kprobe *p, if (!kernel_text_address((unsigned long) p->addr) || within_kprobe_blacklist((unsigned long) p->addr) || jump_label_text_reserved(p->addr, p->addr) || + static_call_text_reserved(p->addr, p->addr) || find_bug((unsigned long)p->addr)) { ret = -EINVAL; goto out; -- 2.30.2