Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp337034pxm; Wed, 2 Mar 2022 16:43:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl6xpbhuHw3wUy2VssOqn5e45ZMVIYUXLdwM2XCg2YKZeLYo2FcrBv7H5aHTTnCcGt37FS X-Received: by 2002:a17:90b:1104:b0:1b8:b90b:22c7 with SMTP id gi4-20020a17090b110400b001b8b90b22c7mr2543952pjb.45.1646268215723; Wed, 02 Mar 2022 16:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646268215; cv=none; d=google.com; s=arc-20160816; b=gJOyoHDWo21QBMDay7z+8uUAdwqDzsQRnQhp0Bw8PdJfgJ6yZs7lxZjg6y3onM6qkV xNwvyJ+JV3Je/jclUew3rMeW6oDhUTko9zkxuCTvJHn/7x3qMB8s6LOn/FlXjh/w+Qrj yPNE784yoAv+fjib019CzzdVjNFe0Zerre75JauaaC8S6qX+hb/4VtAGObJ3FcRDb6HK VZRnORNUL4qrmrewgyOnlx41lQxULyAncr+V2ujioZVnaC2CVRij/cEvlfVSIoZd4HHA opovLaST2F0th/67inetyjKFv7gaKeRDoGdmm2vsZPgD0rni6uOyWDcKihI+7GOyqY21 I2hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xp3pBG5frtmnoItK+ASfCHMXDVkQgLnQVjOGQIgA9ZM=; b=cL0r5mq8hJdzApWPluLod+ubasym7KKUuAHK/67QD7Zsfci2XLDEkm4jh8vRPPAgfo BCguyZCJJ6grMSJ7UK0m1pjDsiKTr8ulZkC7kwEdVf6xGIXjzQs524MCX16TdAlejc+u /Xq+N/A68hJkIBfA+aw+Og/Aik8usSsvzXw9iqSwvPjNcJEQeznZQQLsR3OHMuqGggWL T55kecd8NFC+pbOwY5NYZSTDcdR558qYI/w8mfr4HgQlH4iRxz+TSa0PLloJJ8toDuod spaiY1hntyjxxGBGw57+DK5s6UMtic7Qavc7U3Br22AT21D+mRceCopZQt0U/modfC5O bBoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i17-20020a170902c95100b001500c819564si670981pla.38.2022.03.02.16.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:43:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C1EA575E76; Wed, 2 Mar 2022 16:00:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbiCCABM (ORCPT + 99 others); Wed, 2 Mar 2022 19:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbiCCABK (ORCPT ); Wed, 2 Mar 2022 19:01:10 -0500 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B165BE6F for ; Wed, 2 Mar 2022 16:00:14 -0800 (PST) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1nPXw4-0006DF-BS; Thu, 03 Mar 2022 09:59:09 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 03 Mar 2022 10:59:08 +1200 Date: Thu, 3 Mar 2022 10:59:08 +1200 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, ebiggers@kernel.org Subject: Re: [PATCH v2] crypto: crypto_xor - use helpers for unaligned accesses Message-ID: References: <20220223070701.1457542-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220223070701.1457542-1-ardb@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, Feb 23, 2022 at 08:07:01AM +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 > --- > v2: fix issue in crypto_xor_cpy() > > crypto/algapi.c | 24 +++++++++++++++++--- > include/crypto/algapi.h | 10 ++++++-- > 2 files changed, 29 insertions(+), 5 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt