Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp464281lqp; Mon, 10 Jun 2024 09:14:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7SM1T1XiB9ya07P3gj0N2vxkMzYqcqz0AZwi0Fkujiv5tWs/NRl3XYvLAIz997CB1GTCfY4/15IrALnLjVvxmdq629z7QFl27YwkSvw== X-Google-Smtp-Source: AGHT+IEAeJ84BDuDlrRmo2UEKuJQvwSQ7NFzvcHtMa5CbT38EUNHKc86ZOb6nGqInXmzygnSgcPx X-Received: by 2002:a05:6a00:670d:b0:702:3c08:826a with SMTP id d2e1a72fcca58-705a851a08cmr97522b3a.11.1718036046644; Mon, 10 Jun 2024 09:14:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718036046; cv=pass; d=google.com; s=arc-20160816; b=Y/onpSD3omD/O8OjJV2DXvYEHjIw2mP3cqVSBFrxv3Ed80FksOZIyIp6fJ3rcGPvXN BNSvLla3bQ5JWxS5hS/+jFohitEuQJTIj51knZMfwoh66iGdvXk9VMznms8P7yfJmzsN nPTV86Vu/DT6Gd2E4O3w+Ab4nszpq4I/idvZeZRP84RRlGBOfMR46iKlSt936nvAXNNm 7vGOwHSSrh8WdVfQnZMm8Q8x7r02Ttps6brDUoVHqohj7Up2N/V2Zz+8DYqaDJ8ZuGFl BXZ2yORuWQnVqeihIspIeltqOWuAcg8iJJIL9XqscMbrVWd8T5s4bOjANTdj/ghFt+WV 9qjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=DMRJJSTKqYUGD8dus+yMRcwA/79j6mVNZpg6fqpBuM4=; fh=OChsNOiUzvh99f4Gn4NVsKjy2JP2+eyg/zqRHRrCp1w=; b=daQb9arPUzJnbw/+qmxYfCDEgBtJICGaZR8Yoo9EgKELYrEmp6FEcXucFjL2z6FNeY UbvmSYhPbABbPbg0FV4NGiPVUP4yY+svg5KaAgaFV08y5dKj8q80xSEk65N0SSdyqYre 6eF7J/ANh5doAf4Btn9A27eGZxIoWKUiXzvPtbiPkwZEclKOxJnioJ/67PJfDOcRmpbA tFCjzXo/TK6oIHz7rgJBPwNP3atmQuK0Z2wIqNaMUJKrktQZVKu6G0fgiIuNdD1WGt7w 1LmuMfie7rV6jmqRjh2D4sQ9UH0Qr8BtdGJ1DjlL5h6lANy7GsoLuPYyGM4DmfMKg4z/ zhjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=BjJNzUou; arc=pass (i=1 spf=pass spfdomain=flex--ardb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-crypto+bounces-4863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-70436c14454si2773635b3a.240.2024.06.10.09.14.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=BjJNzUou; arc=pass (i=1 spf=pass spfdomain=flex--ardb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-crypto+bounces-4863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EAC59B2CDDE for ; Mon, 10 Jun 2024 15:29:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0623714388F; Mon, 10 Jun 2024 15:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BjJNzUou" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5515613DB9B for ; Mon, 10 Jun 2024 15:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718033211; cv=none; b=AANL+YhO+SDovqQN9k/AHMchOR2jjWo1wVB7E2q3eT2wBDizbM+OGlLSqh/pVb2irnWwowQWSbJjbGI3DGA3xmODkwrbsloR/yT7AWoTfQHnbKz+InWcEPQsQ3yZxEN5M9w54qZDFcww7IhYdNtUCWIsbdCcVIvmOOVfXTf2VFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718033211; c=relaxed/simple; bh=djm11PbPLUTyQQJ9l3sDzgoLBWIugExYLbEBTnWiegA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=SKFkBefeDy8c5uk956ceniWe/v+poFJaVEs9wRab4jtdXylc99mnpBnZkcAts4ix06qoffrjO7lmmOVzZhn2HJXebS4rioq4RBf+Od8Y+JkVsRUGiXKZ0IgAAiFZYNO55VMALeY4HJj0RaeWoZL1tzDDH9rB/MwYlTbG6hPgDQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BjJNzUou; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-421eed70e30so7195515e9.1 for ; Mon, 10 Jun 2024 08:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718033209; x=1718638009; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=DMRJJSTKqYUGD8dus+yMRcwA/79j6mVNZpg6fqpBuM4=; b=BjJNzUoudrPRDwJ8vhBC0bJ3GZCfl5qF2FNbd1VfERaHj+4B/WmwHdeOFQyQKspulS mF7+wgKFjHC+rE2rBKShSz9L490mbPSck+3xbeGQEchgSPndpe9EFptOmDa/LBOwk7w9 cfpUSgGByYAQlWpMj6RFJURMwhC9/k7cgvhNL6NwxLnMCZz2gNdzppHgaI0gw5NOOBPJ ZwhDH3zs7DS8uxs7SILKeVcjstwwaGF+hocnk+5dUuoxSDLUTa4jV051ITMmDHl5SQwE eI1MBCieWARIV1P9t720tyCWzSqVDOJbBGT6cF7A96AuEjAJTIe+2O3F1zJGuuyEXWso kMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718033209; x=1718638009; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DMRJJSTKqYUGD8dus+yMRcwA/79j6mVNZpg6fqpBuM4=; b=BqMMygt3TKN8tugCh0hsCLgq4qaFfidwPLVUCfIp9OSOIeL8Ie3HIqqOok+DkdWBxN CYkgIwTbo2RN6oWIbJHzsBNiRcZAWISY/ahMjeXfpeJWR5R1LlqT7o1UadAOWGZ1Ejyu umuBZ+9PTc8Y7h8EML45yr0oQp2GF1cR0PJe0vUZYRS64Emzx38RBR/ErQfYJnJE+8d1 c4l5c77m10dAUrSoQFSHwO5GaIamvrsv+6/QZExiVYIbXAr+ErfiuKCx2N7Wjo5eoxTa /CXQaUautUFq0EpX9jnNVsYYC9dm/rFEE+BH5F5d+w5DB0dFrjjyU+IXlbjdNGzRxtzL uUzA== X-Gm-Message-State: AOJu0YyOqRxt6jlCQ4/W8Ml4KA2RZCM/oNSErSFKeK//Nwu7lhWhd5Kx UDE2MgvdyT+4WEQFmq95Vzsq7KDuP064A03nVzwi//R/AsKah9HurEvs/jzvvXHeoOmv3i85D8M qx/nfVfXCCT6IM2peacJ8S9LWV3/YJEWzovs+uEWc4JcVj+LwYwrUflQ7Y9Ebi6p8BYdQhNKCJ5 udb+Wfyu/DbQpBHp3YWS8DCpYnb4GDBQ== X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:a05:600c:5487:b0:41f:e5af:181e with SMTP id 5b1f17b1804b1-42164a4e229mr408355e9.7.1718033208283; Mon, 10 Jun 2024 08:26:48 -0700 (PDT) Date: Mon, 10 Jun 2024 17:26:39 +0200 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1742; i=ardb@kernel.org; h=from:subject; bh=eJNPUyXrEg+4UdWAVwkHUS/E+tlxeHkytZaImtWFzIg=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIS1dWn/dQ06xa7aMn3l3LbaR6hWs1Np5teBSz7+sug23P oflSz3uKGVhEONgkBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABPJnc7wT69IwtFPpvN/y/+7 Wxg77slM8LghKBZ9uEr/3+zyi9InlBj+Sk+1KnEoyzgmLs4Xu2au+k6pq8ECnGs2vXyuJTLnwF1 NXgA= X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog Message-ID: <20240610152638.2755370-2-ardb+git@google.com> Subject: [PATCH] crypto: arm/crc32 - add kCFI annotations to asm routines From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: linux-hardening@vger.kernel.org, herbert@gondor.apana.org.au, Ard Biesheuvel , Kees Cook , Linus Walleij Content-Type: text/plain; charset="UTF-8" From: Ard Biesheuvel The crc32/crc32c implementations using the scalar CRC32 instructions are accessed via indirect calls, and so they must be annotated with type ids in order to execute correctly when kCFI is enabled. Cc: Kees Cook Cc: Linus Walleij Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/crc32-ce-core.S | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/crypto/crc32-ce-core.S b/arch/arm/crypto/crc32-ce-core.S index 3f13a76b9066..88f9edf94e95 100644 --- a/arch/arm/crypto/crc32-ce-core.S +++ b/arch/arm/crypto/crc32-ce-core.S @@ -48,6 +48,7 @@ */ #include +#include #include .text @@ -123,11 +124,12 @@ * uint crc32_pmull_le(unsigned char const *buffer, * size_t len, uint crc32) */ -ENTRY(crc32_pmull_le) +SYM_FUNC_START(crc32_pmull_le) adr r3, .Lcrc32_constants b 0f +SYM_FUNC_END(crc32_pmull_le) -ENTRY(crc32c_pmull_le) +SYM_FUNC_START(crc32c_pmull_le) adr r3, .Lcrc32c_constants 0: bic LEN, LEN, #15 @@ -236,8 +238,7 @@ fold_64: vmov r0, s5 bx lr -ENDPROC(crc32_pmull_le) -ENDPROC(crc32c_pmull_le) +SYM_FUNC_END(crc32c_pmull_le) .macro __crc32, c subs ip, r2, #8 @@ -296,11 +297,11 @@ ARM_BE8(rev16 r3, r3 ) .endm .align 5 -ENTRY(crc32_armv8_le) +SYM_TYPED_FUNC_START(crc32_armv8_le) __crc32 -ENDPROC(crc32_armv8_le) +SYM_FUNC_END(crc32_armv8_le) .align 5 -ENTRY(crc32c_armv8_le) +SYM_TYPED_FUNC_START(crc32c_armv8_le) __crc32 c -ENDPROC(crc32c_armv8_le) +SYM_FUNC_END(crc32c_armv8_le) -- 2.45.2.505.gda0bf45e8d-goog