Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1970809rdb; Sun, 19 Nov 2023 19:29:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlLAWlqxwnbC2o/NLvmA2K6HmKh/6tNxzDH9lbKwmwAwvvQeLf6iSyvbwpaG/zXfCnlTX5 X-Received: by 2002:a17:903:2281:b0:1cf:5806:564f with SMTP id b1-20020a170903228100b001cf5806564fmr5472257plh.10.1700450989910; Sun, 19 Nov 2023 19:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700450989; cv=none; d=google.com; s=arc-20160816; b=E7/jqwaCYUHPCX+dwvu8uC7UB6/CuSmgmaLBo9z1Fl6122uWQ/HszY/QJJtn9y/EPO hBF+KRxP53YkECw9OTzHzTiy/J5BbWgmUJt7n4nEC/miRlllrIQPXBMds3dHhDae0nFz nebGrEpVkEs4uhcRyre36PumKDkGZrtSD1MuTZT20x+0jvJu9WCkJ89nom3lTHGowDpQ 9Pi11AT480IIkSQKf7si4xDLvSxDgRnNlCwEjXwyOACHCPBqD/SeHC4Gj//HBoy9gBWi pd3xJvL9DW/Z39Oz+rabGpY6xQIUPdZtsvfrqaCZlMEk1LTpG5kr6C0n06nssZqpzzNy BnYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=MXZb06dO0e5VghAyynbrHW/Ridb0Wla0tD7TN/K48VU=; fh=LKKYSIeu07MN+GCsSyicxRWeswAPsHEh9BTAiLcBIeE=; b=iHQ5m3VNHCKEG7ye3Jh/s359XVGXMC3npQNvtLYeVPMtV4mwRVEZNtqJ4U1MO+bvLG GBPySoEr8w5kQHEDnJVkR3Cs0VKtj83HnqVqKvTYTNNxF65thlELvp6aHooDLnXD3e2O Ki+8lfUQvzk3HJJ8BJRsSSVZWgzBKMPR6t+HBpB9VovKHxEHvcjvLFoUuLf89vny0Qyu POg5I5q97uPzaQpHkELj8e2RYDQD+vvkTyc2CmCh+Lc2pDsyw7vSyhLWPIe9w2wZRkpG M7djvIM33xxH7QcO3eI22LuonIrX8QeB1zOII/HNiuzEtSYzeKzA5wiMS1/T7hMfbQqh KnLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ixn1s+IH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u14-20020a17090341ce00b001cad3a9ff1dsi7553362ple.571.2023.11.19.19.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 19:29:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ixn1s+IH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BABB080408CE; Sun, 19 Nov 2023 19:29:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbjKTD3s (ORCPT + 99 others); Sun, 19 Nov 2023 22:29:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbjKTD3r (ORCPT ); Sun, 19 Nov 2023 22:29:47 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A667194; Sun, 19 Nov 2023 19:29:43 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AK3CHTS018348; Mon, 20 Nov 2023 03:29:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=MXZb06dO0e5VghAyynbrHW/Ridb0Wla0tD7TN/K48VU=; b=Ixn1s+IHueCaAZ9vsiRKzv9XnqXnhCuJWVV320N00kpBi4AJvBK1V8GvyK3Atr9NxV2R e9XShkuHfcaVioiuLev4OSpBtluwhYsGOqDqxBKNbxi76KHuS6ZtPQVVwWQ7hWHZICsP SdfMlhE0+ZHvFiahOLFKU+kUhm+vZfTwcVB5dNBtrOREUdBXaeiMzQzrdm/N+5oV5vp+ ZR66TNmacWXqbd1jsD+irMeN3tzEBCseu2lDe8mS0tQP4OudAaq16Y12zX8Amx9q3dD7 wDehqtj5ZZvPCYHSpbvij88UcL9IuBX+65/4uzs9MVu38x/yeNQI2bMSPWe32537pGU+ Ow== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uemks2rng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 03:29:31 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AK3TUpr032694 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 03:29:30 GMT Received: from aiquny2-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sun, 19 Nov 2023 19:29:24 -0800 From: Maria Yu To: Nathan Chancellor , , , CC: Maria Yu , , , , , , Subject: [PATCH v3 1/1] ARM: kprobes: Explicitly reserve r7 for local variables Date: Mon, 20 Nov 2023 11:29:09 +0800 Message-ID: <20231120032909.19186-1-quic_aiquny@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nXIc84DIJG67fapBTqJd7EOTyenoPWSf X-Proofpoint-ORIG-GUID: nXIc84DIJG67fapBTqJd7EOTyenoPWSf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-19_21,2023-11-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 mlxscore=0 adultscore=0 malwarescore=0 mlxlogscore=561 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311200024 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 19:29:48 -0800 (PST) Registers r7 is removed in clobber list, so compiler may choose r7 for local variables usage, while r7 will be actually updated by the inline asm code. This caused the runtime behavior wrong. While those kind of reserved registers cannot be set to clobber list because of error like "inline asm clobber list contains reserved registers". Explicitly reserve r7 by adding attribute no-omit-frame-pointer for this file, then in T32 asm code r7 is used as a frame pointer and is not available for use as a general-purpose register. Note that "no-omit-frame-pointer" will make the code size a little bigger to store the stack frame pointer. Fixes: dd12e97f3c72 ("ARM: kprobes: treat R7 as the frame pointer register in Thumb2 builds") Suggested-by: Ard Biesheuvel Signed-off-by: Maria Yu Cc: stable@vger.kernel.org --- arch/arm/probes/kprobes/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/probes/kprobes/Makefile b/arch/arm/probes/kprobes/Makefile index 6159010dac4a..b1f21e78950b 100644 --- a/arch/arm/probes/kprobes/Makefile +++ b/arch/arm/probes/kprobes/Makefile @@ -8,6 +8,7 @@ test-kprobes-objs := test-core.o ifdef CONFIG_THUMB2_KERNEL obj-$(CONFIG_KPROBES) += actions-thumb.o checkers-thumb.o +CFLAGS_actions-thumb.o += -fno-omit-frame-pointer test-kprobes-objs += test-thumb.o else obj-$(CONFIG_KPROBES) += actions-arm.o checkers-arm.o base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263 -- 2.17.1