Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp522743lqp; Wed, 12 Jun 2024 08:25:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDUzmiAjsdt5U2HYjXeqWKdMDgWpEbXnrMy7X38PYQLT/50/IJ4KCoOVzfuYhbfBpEp0GQzF7Xu3+de5FxOd4S6bTBcS0g+UGsOKovnw== X-Google-Smtp-Source: AGHT+IFmP7I46NvmJQzPg2K9ZJu64vJ3yypKdow//lW6y8MosPKbPb6E34mObwpxqEeK0wPyYFCP X-Received: by 2002:a17:902:f70b:b0:1f8:3d1d:b3a5 with SMTP id d9443c01a7336-1f83d1db711mr22517755ad.23.1718205956594; Wed, 12 Jun 2024 08:25:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718205956; cv=pass; d=google.com; s=arc-20160816; b=QwvZUwE+yEceAqCeSgj9bpTnyiRUuiItbhAhNut6EJ9cIdPjIOdXh3qCElDn9jAaeH Fu/g10TzxiWEgoR/CdkYgviO4TXmKpsN8Hjd2xk3ds64H4zDzNMT89IE11yUe9BkfSmm wFyjL5VdP6iaX0ySOLLD9YLL9ctkv+z1eLAON2d3CJL9JdxXgw2rMGZs1t/iq9vOXR67 Xg7lJ7/fBjyRnTbRC1GPZvVmvtcaqYRgksxx/o1HjGWaCG5Lft/iDyMrFMcTCof12XjM PHdiK3LJWvANSn21DrnBTZKMRulvOUj0kygl1hqDpsjfdMhFQ6yXyaiGC/PBmHFdS0tw v8qA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=Nif5h10AV3M6Q2YnmVp8PmeGHT2QNIT0qX59Shur4c4=; fh=6T1cn+zZISETfkSQY+ffbsWoINvS+CfK4zu/XnbAny8=; b=fY7AEXlMQ6VeAuewy79z6g+30x1bvaiDbF6r1AHl2tBUBAL9rCgn9GT+xgM9mdvZo+ zqmDFXxsia3LIYgXwFmcvEKxqTzpO1Ov9G1me9mBV6HIbNMXhHOtgpgwdThkyrv/M69U Qs0ZxxvMum8/xmNlTYKpISNItv9sZd5amzn4HjntwsA37BRR2mVPY2ZliD59kiE/R0fV RUJkmQyX3DSr+1WGTsEsrjK0b6JH+hg/ZVOlK1H2GFFYQz/ATOzQpUQlx/rCCET8nnD2 hGpv4OwkFRBv1Gsg/bCXkHmVe8aAwQNEURjzsQj3vTkqoMet3PG/6SG7AvOCDBIFJo8F SZmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@motorola.com header.s=DKIM202306 header.b="xC/AhsGg"; arc=pass (i=1 spf=pass spfdomain=motorola.com dkim=pass dkdomain=motorola.com dmarc=pass fromdomain=motorola.com); spf=pass (google.com: domain of linux-kernel+bounces-211786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211786-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=motorola.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f71d6dd908si48516405ad.466.2024.06.12.08.25.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 08:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@motorola.com header.s=DKIM202306 header.b="xC/AhsGg"; arc=pass (i=1 spf=pass spfdomain=motorola.com dkim=pass dkdomain=motorola.com dmarc=pass fromdomain=motorola.com); spf=pass (google.com: domain of linux-kernel+bounces-211786-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211786-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=motorola.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3712F2830FD for ; Wed, 12 Jun 2024 15:25:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8151717F517; Wed, 12 Jun 2024 15:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=motorola.com header.i=@motorola.com header.b="xC/AhsGg" Received: from mx0a-00823401.pphosted.com (mx0a-00823401.pphosted.com [148.163.148.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C78617E90D; Wed, 12 Jun 2024 15:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.148.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718205945; cv=none; b=qeFLX3Rmh5N/9SZ7y1kPAlL+Fb/EhP9JRo2ILRyQYS2L6gQkyE5k6hBQTpBvhgQKXPNvt3rMRU71hjJbzsTtHSXgwPFjxnVG9ipIqFI2db/LCbeNOMnXPTT/lgr/RLX7mHSKcI53Uk0LQiRl96bxKkreMeXZVvt2yX0sA+k4a8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718205945; c=relaxed/simple; bh=1e8r/pvg4fjFrlQ0hRQpudGRd6zFpIJjeF5GWMXYND4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=YIRQHKX5l4Z90d3QRqYXTTr2FYBUP8D8jniht/e1tYLAFRbtbfkEqvR0tFIaflIlphLiM3f8iDAzt8y92vhOyQcA6lfkYTB5WGivf3j+Zd5MZfTZ4ydyzWgo1A3OzeyeAWMTHFtqmy7Ieth+dIMUX5CntGbBbewR6Vus2ysIg58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motorola.com; spf=pass smtp.mailfrom=motorola.com; dkim=pass (2048-bit key) header.d=motorola.com header.i=@motorola.com header.b=xC/AhsGg; arc=none smtp.client-ip=148.163.148.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motorola.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=motorola.com Received: from pps.filterd (m0355085.ppops.net [127.0.0.1]) by mx0a-00823401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CD7orp007922; Wed, 12 Jun 2024 15:24:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motorola.com; h= cc:content-type:date:from:message-id:mime-version:subject:to; s= DKIM202306; bh=Nif5h10AV3M6Q2YnmVp8PmeGHT2QNIT0qX59Shur4c4=; b=x C/AhsGgjbGdZOGKcS60dYzydPWImOrXmF15UJRfi1f8rquwSRjOzYdq/n7rorDjG gz4+fXDt3GciYodoj+hyedxsYUyqksynfNJpgXGKoUKKQ1q8iwEe4ObaL4PHfIuA bTJn+CvKWLGrJ22QZ7sfToigLLnyHyuB+bowbFrGPUqtDvpL+dX6tRYb1XMRTsk9 xWO+RcNvGC8jgIbalrY+iaFdDnFNdNjfwU42gn0WoVimisury/vvZ+YDgA9ZW8yg iIUOojN7EctYOiVN+7FFgARDPEBZfnFKOH6B7Cep6JIJ/yy8TPtqvCv2YSa5803e 4BzAM0IwPB86hdMlXIUDA== Received: from va32lpfpp03.lenovo.com ([104.232.228.23]) by mx0a-00823401.pphosted.com (PPS) with ESMTPS id 3yn5tffjty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 15:24:58 +0000 (GMT) Received: from ilclmmrp02.lenovo.com (ilclmmrp02.mot.com [100.65.83.26]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by va32lpfpp03.lenovo.com (Postfix) with ESMTPS id 4Vzq952VhBz4ygs5; Wed, 12 Jun 2024 15:24:57 +0000 (UTC) Received: from ilclasset02 (ilclasset02.mot.com [100.64.49.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mbland) by ilclmmrp02.lenovo.com (Postfix) with ESMTPSA id 4Vzq950sT2z3p6jp; Wed, 12 Jun 2024 15:24:57 +0000 (UTC) Date: Wed, 12 Jun 2024 10:24:56 -0500 From: Maxwell Bland To: "open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)" Cc: Catalin Marinas , Will Deacon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Mark Rutland , Suzuki K Poulose , Mark Brown , linux-arm-kernel@lists.infradead.org, open list , Josh Poimboeuf , Puranjay Mohan Subject: [PATCH bpf-next v6 0/3] Support kCFI + BPF on arm64 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Proofpoint-ORIG-GUID: lc9IdRiRRKi7tGObDRgEm7AaeqVO78U7 X-Proofpoint-GUID: lc9IdRiRRKi7tGObDRgEm7AaeqVO78U7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_08,2024-06-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 mlxlogscore=756 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120110 Adds CFI checks to BPF dispatchers on aarch64. E.g. : paciasp stp x29, x30, [sp, #-0x10]! mov x29, sp + ldur w16, [x2, #-0x4] + movk w17, #0x1881 + movk w17, #0xd942, lsl #16 + cmp w16, w17 + b.eq + brk #0x8222 blr x2 ldp x29, x30, [sp], #0x10 autiasp ret Changes in v5->v6 https://lore.kernel.org/all/mafwhrai2nz3u4wn4fu72kvzjm6krs57klc3qqvd2sz2mham6d@x4ukf6xqp4f4/ - Add include for cfi_types, fixing riscv compile error - Fix authorship sign-off information Changes in v4->v5 https://lore.kernel.org/all/wtb6czzpvtqq23t4g6hf7on257dtxzdb4fa4nuq3dtq32odmli@xoyyrtthafar/ - Fix failing BPF selftests from misplaced variable declaration Changes in v3->v4 https://lore.kernel.org/all/fhdcjdzqdqnoehenxbipfaorseeamt3q7fbm7ghe6z5s2chif5@lrhtasolawud/ - Fix authorship attribution. Changes in v2->v3: https://lore.kernel.org/all/20240324211518.93892-1-puranjay12@gmail.com/ - Simplify cfi_get_func_hash to avoid needless failure case - Use DEFINE_CFI_TYPE as suggested by Mark Rutland Changes in v1->v2: https://lore.kernel.org/bpf/20240227151115.4623-1-puranjay12@gmail.com/ - Rebased on latest bpf-next/master Mark Rutland (1): cfi: add C CFI type macro Maxwell Bland (1): arm64/cfi,bpf: Use DEFINE_CFI_TYPE in arm64 Puranjay Mohan (1): arm64/cfi,bpf: Support kCFI + BPF on arm64 arch/arm64/include/asm/cfi.h | 23 ++++++++++++++++++++++ arch/arm64/kernel/alternative.c | 18 +++++++++++++++++ arch/arm64/net/bpf_jit_comp.c | 21 +++++++++++++++++--- arch/riscv/kernel/cfi.c | 35 +++------------------------------ arch/x86/kernel/alternative.c | 35 +++------------------------------ include/linux/cfi_types.h | 23 ++++++++++++++++++++++ 6 files changed, 88 insertions(+), 67 deletions(-) create mode 100644 arch/arm64/include/asm/cfi.h -- I had one job, make it compile for riscv. Fixed. Thank you again to the maintainers for their review. Normally I would wait a week before submitting a new version, but with the delays on v5, I am submitting sooner to bolster confidence. 2.43.0