Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp369684pxm; Wed, 23 Feb 2022 02:06:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGuwdQpAFiYdLITaihCYqPjWaJXdJGhRDviQI4OME6sju9TeX2qUfTnMN/boL1UwQJiShm X-Received: by 2002:a17:903:310d:b0:14f:ef77:d685 with SMTP id w13-20020a170903310d00b0014fef77d685mr3993543plc.163.1645610798904; Wed, 23 Feb 2022 02:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645610798; cv=none; d=google.com; s=arc-20160816; b=Z+vQAibSTpz0SMl/X7eYVUTzVMN14rBGa853iSrmHF1RE9XTR/tfV/xf1+xOtKYPZv iWyfsyeNCOC+bD8BK5RyRgcuyma+fCTIB1UAHXctcqbtZRLO8RNCzitqQmtRDhPbF3g9 Y6Bor8cfzcdEksFw6Fzpb8yiP8JAGK9gRtRuWGPYfjWZPFW4/tTbb30vxJNQwGm8ZPK7 YT8OrT/+/ucIprZfR+RqXO0vWCjqQ0v2sm490h93MjVg03BCr86iTtMA2kDyPHlCRPQa J5cZYRyYnYpzJBFPwPqjdDNdi6ucR+GjkbVuohIVNlUy27VkAtP6QDuF7R5i9yGvMklx QeGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=U8teOX2bnr2ihE4Ki19nIpED7NdT+j4jwwLcxLUkgAE=; b=oWTn7aZNWg1SshsyixHNKrDThIeHxs2PFQkR3FV30F7rEEQ59Huvncegv4IIRP7JoP rvKOHcdFNnUxSERwfr62aDnAfkyjxyIdczz1ZsUiW9kJXB/dO/R/wp36L4wgZpxyut44 EwV1IWNwRcZfjOIzjxWKyW0cy2/bazvNz36CDynLVutvGDRMBfJDH7nig8Cm9w4NlC8v i6YPRuITe9F+vBSszU40dQiX1KNOhWvkH43HMMCVmgOz4fVSAijhceqHspEO8iksb5eM ngil2v4RtsINbAIjaxXoaYCWAaCNM7++SClqyeHmc0s/7w+CzNs0QszQmGS8JLB2qMo7 r3Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sIwX1W4X; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10si317168pgr.716.2022.02.23.02.06.14; Wed, 23 Feb 2022 02:06:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sIwX1W4X; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233018AbiBWGpg (ORCPT + 99 others); Wed, 23 Feb 2022 01:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbiBWGpf (ORCPT ); Wed, 23 Feb 2022 01:45:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBFA06D874 for ; Tue, 22 Feb 2022 22:45:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8755161484 for ; Wed, 23 Feb 2022 06:45:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB11FC340E7 for ; Wed, 23 Feb 2022 06:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645598708; bh=6xg8D/XX6WqodUh2YEOZYBPRCmDxcytkiqDeRi/LDEA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sIwX1W4XS9acxVOtG6Fy3wuMnh2z9X3fhSZbW4Bu2RzeXVu+lrWD7TvVoDTl/5IVX Qe9TK1WWFTPczBxNhY74Leg6jM96e/dks4YBlSCH+Rujsn/zhi9l/H+8ZUtwPcCOVJ bkCuAVkG4FKKw1WCliyxgDvVRc2g5ATARwyS4JHBCvl3wXFhO3yV7SXXJQ6Ar+b/vH myJjplATr0N2IRWuwoRhevijuoQBbU4JlzOFqLcYQsuKJvMR01svf6jDaUvW3DvDIa oHnamT81IZguh8Fjj079+wSuQsUcCvbVXGyNMzi/hUqPhotuRPgU8e8JpDBXilSgLy oDFy+LOIJhFIw== Received: by mail-yb1-f171.google.com with SMTP id j12so45959853ybh.8 for ; Tue, 22 Feb 2022 22:45:07 -0800 (PST) X-Gm-Message-State: AOAM532CSU9/dM6UFimZ96JiGlVVEj+CkO6hPWpfRzknstzPjOoCSyWJ cCc9LC7zDI4+SvBm85+YzlVyWBKnN6iOAxcTbwg= X-Received: by 2002:a25:24ce:0:b0:61e:1276:bfcf with SMTP id k197-20020a2524ce000000b0061e1276bfcfmr26619857ybk.299.1645598707010; Tue, 22 Feb 2022 22:45:07 -0800 (PST) MIME-Version: 1.0 References: <20220215105717.184572-1-ardb@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Wed, 23 Feb 2022 07:44:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] crypto: crypto_xor - use helpers for unaligned accesses To: Herbert Xu Cc: Linux Crypto Mailing List , Eric Biggers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-crypto@vger.kernel.org On Wed, 23 Feb 2022 at 03:50, Herbert Xu wrote: > > On Tue, Feb 15, 2022 at 11:57:17AM +0100, Ard Biesheuvel wrote: > > Dereferencing a misaligned pointer is undefined behavior in C, and may > > result in codegen on architectures such as ARM that trigger alignments > > traps and expensive fixups in software. > > > > Instead, use the get_aligned()/put_aligned() accessors, which are cheap > > or even completely free when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y. > > > > In the converse case, the prior alignment checks ensure that the casts > > are safe, and so no unaligned accessors are necessary. > > > > Signed-off-by: Ard Biesheuvel > > --- > > crypto/algapi.c | 24 +++++++++++++++++++++--- > > include/crypto/algapi.h | 11 +++++++++-- > > 2 files changed, 30 insertions(+), 5 deletions(-) > > Ard, could you please take a look at the two kbuild reports and > see if there is an issue that needs to be resolved? > My patch is flawed - I'll fix it and send a v2.